Date list between two dates on Oracle SQL
Get the list of dates between two dates by Oracle SQL
Topic Introduction: In this tutorial, we will discuss how to find out or retrieve a list of data between 2 dates using SQL Query. I have given a sample query and its output results below. in this query I have used 2 Parameters, SDATE (Start Date) and EDATE (End Date), and the value is given 01-OCT-22, and 05-OCT-22
SELECT TRUNC (TO_DATE(:SDATE,'DD-MON-RR') + ROWNUM)-1 DATE_LISTFROM DUAL CONNECT BY ROWNUM < (TO_DATE(:EDATE,'DD-MON-RR')-TO_DATE(:SDATE,'DD-MON-RR'))+2;
No comments