Oracle query returns multiple rows from the dual table

 Meanwhile check out the ten data

select * from dual connect by 0 + level <= 10;

 

Days between two dates calculated according to this feature:

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

 

Original link:

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

 

 

reference:

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

 

Guess you like

Origin www.cnblogs.com/poterliu/p/11972589.html