Oracle 从 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');

 

原文链接:

https://www.cnblogs.com/poterliu/p/11972589.html

 

 

参考:

https://blog.csdn.net/cenhonggang86/article/details/83729674

 

上一篇:oracle-常用函数


下一篇:hive函数