筛选表a中操作时间介于c的from_date和to_dateselect
a.oper_date
from table1 a,(select b.from_date,b.to_date from table2 b) c
where a.oper_date>=c.from_date and a.oper_date<=c.to_date请问最后这个条件应该怎么写?
a.oper_date
from table1 a,(select b.from_date,b.to_date from table2 b) c
where a.oper_date>=c.from_date and a.oper_date<=c.to_date请问最后这个条件应该怎么写?
--如果a.oper_date,c.from_date,c.to_date都是date类型,那么就直接比较
a.oper_date>=c.from_date and a.oper_date<=c.to_date
--如果都是varchar2类型,那是用to_date()函数转换后再比较:
a.oper_date>=to_date(c.from_date,'yyyy-mm-dd') and a.oper_date<=to_date(c.to_date,'yyyy-mm-dd');