运行此PostgreSQL查询时出现以下错误。谁能告诉我如何更正此查询?
SQL错误:
ERROR: syntax error at or near "fitacf_data" LINE 1: ...fitacf_data.num_pts, EXTRACT(EPOCH FROM TIMESTAMP fitacf_dat... ^
SELECT fitacf_data.file_date, fitacf_data.num_pts, EXTRACT(EPOCH FROM TIMESTAMP fitacf_data.time), fitacf_data.stcode FROM fitacf_data WHERE fitacf_data.file_date BETWEEN '2017-04-14 00:00:00' AND '2017-04-14 23:59:59' AND fitacf_data.stcode = 'pgr';
答案 0 :(得分:1)
如果fitacf_data.time
已经是timestamp
,请不要使用TIMESTAMP
关键字,这是原义的。
...
EXTRACT(EPOCH FROM fitacf_data.time)
...