oracle sql select all days between two dates except weekends

Solutions on MaxInterview for oracle sql select all days between two dates except weekends by the best coders in the world

showing results for - "oracle sql select all days between two dates except weekends"
Alessia
09 May 2019
1-- All dates between 01/07/2021 and 15/07/2021 excluding weekends
2SELECT CAL_DATE
3FROM (
4         SELECT to_date('01/07/2021', 'DD/MM/YYYY') + ROWNUM - 1 AS CAL_DATE
5         FROM ALL_OBJECTS
6         WHERE ROWNUM <= to_date('15/07/2021', 'DD/MM/YYYY') 
7                             - to_date('01/07/2021', 'DD/MM/YYYY') + 1)
8WHERE to_char(CAL_DATE, 'DY', 'NLS_DATE_LANGUAGE=AMERICAN') NOT IN ('SAT', 'SUN');
Tomas
23 Aug 2017
1WHERE TO_CHAR(date_column, 'DY','NLS_DATE_LANGUAGE=AMERICAN') NOT IN ('SAT', 'SUN')