标签:
现要做报表,要查出在当天所处的日期区间的某些数据
,sql语句该怎么写?
就是说 无法直接输入日期,日期得在其他表的start date 和 end date 中获得。
select *
from a
where a.time between
(select b.startdate
from b b
where sysdate between startdate and enddate)
and (select b.enddate
from b b
where sysdate between startdate and enddate);
标签:
原文地址:http://www.cnblogs.com/outlooking/p/4265003.html