PG查询最近24小时
作者:互联网
select date_trunc('h',now()) -interval '24 h';
WHERE
a.req_time BETWEEN (date_trunc('h',now()) -interval '24 h') AND date_trunc('h',now())
参考:
PostgreSQL date_trunc() 和timestamp
https://www.cnblogs.com/jixiaoleng4/p/10599442.html
postgreSQL格式化时间的函数详解
标签:24,www,interval,查询,PG,date,now,trunc 来源: https://www.cnblogs.com/libin6505/p/15557346.html