Oracle 从 dual 表中查询返回多行记录
select 1 as id,'是' as text from dual
union all
select 0 as id ,'否' as text from dual
同时查询出十条数据
select * from dual connect by 0 + level <= 10;
按照这个特性计算两个日期之间的工作日:
select days, week
from (select to_date('2010-08-01', 'YYYY-MM-DD') + level - 1 as days,
to_char(to_date('2010-08-01', 'YYYY-MM-DD') + level - 1,
'day') as week
from dual
connect by to_date('2010-08-30', 'YYYY-MM-DD') - level + 1 >=
to_date('2010-08-01', 'YYYY-MM-DD'))
where week not in('saturday','sunday');