Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle sql select all days between two dates except weekends

-- All dates between 01/07/2021 and 15/07/2021 excluding weekends
SELECT CAL_DATE
FROM (
         SELECT to_date('01/07/2021', 'DD/MM/YYYY') + ROWNUM - 1 AS CAL_DATE
         FROM ALL_OBJECTS
         WHERE ROWNUM <= to_date('15/07/2021', 'DD/MM/YYYY') 
                             - to_date('01/07/2021', 'DD/MM/YYYY') + 1)
WHERE to_char(CAL_DATE, 'DY', 'NLS_DATE_LANGUAGE=AMERICAN') NOT IN ('SAT', 'SUN');
Comment

oracle sql all days except weekends

WHERE TO_CHAR(date_column, 'DY','NLS_DATE_LANGUAGE=AMERICAN') NOT IN ('SAT', 'SUN')
Comment

PREVIOUS NEXT
Code Example
Sql :: how to insert ip address in mysql using php 
Sql :: sql server select first day of previous year 
Sql :: java sql timestamp now 
Sql :: sql views 
Sql :: wildcard in sql 
Sql :: call function sql oracle 
Sql :: alter table add multiple columns postgresql 
Sql :: mysql current time 
Sql :: t-sql drop function if exists 
Sql :: find the median in sql 
Sql :: oracle tablespace tables list 
Sql :: mysql change default collation 
Sql :: select list is not in group by clause and contains nonaggregated column codeigniter 
Sql :: how to change the auto increment in existing table mysql 
Sql :: sql datetime format dd/mm/yyyy hh:mm am/pm 
Sql :: sort by sql 
Sql :: date format mysql 
Sql :: how to find third highest salary in sql 
Sql :: mariadb json select 
Sql :: sqlalchemy update row 
Sql :: mysql grant select update insert delete 
Sql :: how to set up a trigger in sql 
Sql :: inner join distinct 
Sql :: postgres how to index a column 
Sql :: division by zero postgres 
Sql :: change password postgres pgserver 
Sql :: How do I insert a blob in SQL? 
Sql :: create temporary table sql 
Sql :: mysql url data type 
Sql :: sqlalchemy empty table 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =