1. 当天 createdtime 参数
select * from tablename t where where trunc(sysdate)=trunc(t.createdtime);
2.当月 createdtime 参数
select * from tablename t where t.createdtime>=trunc(SYSDATE, 'MM') and t.createdtime<=last_day(SYSDATE)
3.当年 createdtime 参数
select * from table t where t.createtime>=trunc(sysdate,'YYYY') and t.createtime<=add_month(trunc(sysdate,'YYYY'),12)-1
本文介绍了如何使用SQL查询来筛选特定日期范围内的记录,包括当天、当月和当年的数据查询方法。通过具体的SQL语句示例,读者可以学习到如何有效地进行时间范围过滤。
540





