日期:2014-05-16 浏览次数:20949 次
select * from yourTable where time<now()-05/24
------解决方案--------------------
postgres=# \d a Table "public.a" Column | Type | Modifiers --------+------------------------+----------- id | integer | name | character varying(100) | t_time | time without time zone | postgres=# select * from a postgres-# ; id | name | t_time ----+-------+----------------- 1 | 11111 | 09:35:37.738117 2 | 22222 | 09:35:37.738117 3 | 33333 | 09:35:37.738117 | 34444 | 08:30:20 (4 rows) Time: 0.297 ms postgres=# select * from a where current_time - t_time > interval '30 minute'; id | name | t_time ----+-------+---------- | 34444 | 08:30:20 (1 row) Time: 0.519 ms postgres=#