前言
最近工作中涉及时间比较的sql,在这里记录一下
关于时间的比较
数据创建时间与系统时间比较超过10分钟为超时
case when <![cdata[a.create_date < sysdate-10/60/24]]> then '超时' else '不超时' end
8:00~18::30之间的数据,据创建时间与系统时间比较超过10分钟为超
case
when a.create_date between trunc(a.create_date) + 8/24 and trunc(a.create_date)+(18*60+30)/(24*60) and <![cdata[a.create_date < sysdate-10/60/24]]>then '超时'
when a.create_date between trunc(a.create_date) + 8/24 and trunc(a.create_date)+(18*60+30)/(24*60) and <![cdata[a.create_date > sysdate-10/60/24]]> then '不超时'
else '' end