Home » SQL & PL/SQL » SQL & PL/SQL » Dates between two dates
Dates between two dates [message #20274] Fri, 10 May 2002 03:48 Go to next message
vivek
Messages: 59
Registered: October 2001
Member
I want to display all the dates between two dates. For eg if i have two dates 01-Jan-02 and 05-Jan-02. I want the query to display 01-Jan-02
02Jan-02
03-Jan-02
04-Jan-02
05-Jan-02
Re: Dates between two dates [message #20278 is a reply to message #20274] Fri, 10 May 2002 08:23 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Just make sure the table used in the inline view (here, all_objects) has at least as many rows as you want to display.

select :dFrom + rnum dates 
  from (select rownum - 1 rnum
          from all_objects
         where rownum <= (:dTo - :dFrom) + 1);
 
01/01/2002
01/02/2002
01/03/2002
01/04/2002
01/05/2002
Previous Topic: Can I change the value of certain field in a BEFORE INSERT trigger?
Next Topic: combining cursor of recursive iterations
Goto Forum:
  


Current Time: Mon May 20 13:37:31 CDT 2024