0

如何将列值与当前日期的纪元格式进行比较?

尝试了以下查询:

select f_id from (select (extract(epoch from now()))) as epochNow, data_history 
where   (extract(epoch from f_lastmodified) + f_retention_period) < epochNow 

ERROR :
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

********** Error **********

ERROR: operator does not exist: double precision < record
SQL state: 42883

任何指针?

4

1 回答 1

0

尝试类似:

select f_id 
from data_history 
where   (extract(epoch from f_lastmodified) + f_retention_period) < extract(epoch from now())

当你写道:

from (select (extract(epoch from now()))) as epochNow

您创建了一个子查询,它返回 1 行和一列。你把这个子查询命名为epochNow

于 2013-07-26T09:24:24.053 回答