[英]select count postgres interval time
我正在使用它來計數最近75分鍾內發送的數據,但我總是為0,同時有最后75分鍾內發送的數據
select count(*) as result
from data.data
where last_send_date > (clock_timestamp() - interval '75 minutes')'';
關於我的錯誤的任何提示(db引擎postgres)?
這個怎么樣?
SELECT count(*) as results
FROM data
WHERE last_date BETWEEN (now() '- 45 minute'::interval)::timestamp
AND now();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.