orcale查询前一天前一周前一个月数据

xiaoxiao2021-02-28  70

orcale没有datediff函数,可以使用trunc

查询前一天数据:

select * from customer_loan t where trunc(INS_DATE,'dd')=trunc(sysdate-1,'dd');

查询前七天数据:

select * from customer_loan t where trunc(INS_DATE,'dd')=trunc(sysdate-7,'dd');查询前三十天数据:

select * from customer_loan t where trunc(INS_DATE,'dd')=trunc(sysdate-30,'dd');

转载请注明原文地址: https://www.6miu.com/read-73399.html

最新回复(0)