17,377
社区成员
发帖
与我相关
我的任务
分享
select *from tb
where case when stop_date_time is null then start_date_time<to_date('2001-01-30','yyyy-mm-dd')
else stop_date_time<to_date('2001-01-30','yyyy-mm-dd') end
select *
from tb
where (stop_date_time is null or stop_date_time<to_date('2001-01-30','yyyy-mm-dd'))
and start_date_time<to_date('2001-01-30','yyyy-mm-dd')
start_date_time < 传入参数(2001-01-30 )> stop_date_time 数据
stop_date_time 为空时,只考虑条件 start_date_time < 传入参数(2001-01-30 )
select * from table1
where case when stop_date_time is null then
trunc(start_date_time,'mm')<trunc('2000-01-30','mm') and trunc(stop_date_time,'mm')<trunc('2000-01-30','mm') else trunc(start_date_time,'mm')<trunc('2000-01-30','mm') end