我现在有条sql语句来统计时效,比如select date1-date2 from dual;
但date1和date2之间有一些节假日,我怎样处理,才能仍旧通过一条select语句来去掉节假日,得到时效呢?
比如 select [....] from dual;
但date1和date2之间有一些节假日,我怎样处理,才能仍旧通过一条select语句来去掉节假日,得到时效呢?
比如 select [....] from dual;
比如date_list中记录:
date is_free
2009-05-01 Y
2009-05-02 Y
2009-05-03 Y
2009-05-04 N上面的select语句可以关联这张表。
from date_list
where 日期 between date2 and date1
and is_free='Y'