Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试获取 Oracle sql 中超过 30 天(来自 Mod_date)的记录,我正在使用以下查询,它正在返回所有数据,我只想要 30 天前的数据。请有人帮我纠正这个查询示例:- Mod_date 03-NOV-12 12.00.00.000000000 AM 查询:-
select Mod_date from fil_cnfact where Mod_date <= sysdate -30 order by Mod_date asc ;
您的查询要求从今天起小于或等于 30 天的所有记录。将您的操作员更改为=仅请求 30 天前的记录。
=
select Mod_date from fil_cnfact where trunc(Mod_date) = trunc(sysdate)-30 order by Mod_date asc ;