这是我的SQL查询:
select id, max(file_uploaded_at) as latest_date, current_date
from employee_imports
where convert(file_uploaded_at) - integer '90'< current_date AND
error_message IS NULL
group by id
order by latest_date DESC
尽管如此,我仍然会回溯超过90天的价值观。你知道为什么吗?
答案 0 :(得分:0)
select id, max(file_uploaded_at) as latest_date, current_date
from employee_imports
where current_date - date(file_uploaded_at) <= 90 AND
error_message IS NULL
group by id
order by latest_date DESC
这是我更改查询的内容,一切似乎都正常。
无论如何,谢谢你们。