[SQL ] timestamp 的比較 ?
版本:PostgreSQL 8.4.7
我想要將log資料表裡面某天的資料取出來,
其中serial的型別是timestamp without time zone,
可是我用下面的SQL式:
select *
from log
order by serial
where serial like '2011-05-06%'
會出現:
ERROR: syntax error at or near "where"
LINE 4: where serial = '2011-05-06%'
^
不知道是哪邊的格式錯誤了,
我試了好久都沒有辦法正確執行,
想問說到底是哪邊出錯了還有timestamp應該要怎麼比較呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.117.120.10
→
05/06 16:13, , 1F
05/06 16:13, 1F
→
05/06 16:33, , 2F
05/06 16:33, 2F