我用它来计算最后75分钟发送的数据,但我总是0,同时在最后75分钟发送数据
select count(*) as result
from data.data
where last_send_date > (clock_timestamp() - interval '75 minutes')'';
我的错误是哪些提示(db engine postgres)?
答案 0 :(得分:1)
这个怎么样?
SELECT count(*) as results
FROM data
WHERE last_date BETWEEN (now() '- 45 minute'::interval)::timestamp
AND now();