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格式化时间的函数详解