From: | "Madhavi Daroor" <madhavi(at)zoniac(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | sequence os dates |
Date: | 2003-02-25 12:31:08 |
Message-ID: | NHBBKMLNGKEMDMCGAMFNEECKCAAA.madhavi@zoniac.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
How do i generate a sequence of consecutive dates between 2 dates in a
single query?
For example......between '01-01-2003' and '01-04-2003' the result should be
01-01-2003
01-02-2003
01-03-2003
01-04-2003
I don't want to use any pgsql or any othere procedural languag. The result
should be got in a single sql statement. Like in oracle I can do it as
follows by using one of my tables...
select (rownum+to_date('01-01-2000 00:00:00','mm-dd-yyyy hh24:mi:ss'))
timesheetdate
from skills having (rownum+to_date('01-01-2000 00:00:00','mm-dd-yyyy
hh24:mi:ss')) < to_date('01-01-2010 00:00:00','mm-dd-yyyy hh24:mi:ss')
group by rownum;
There is nothing like a rownum in postgres, so how can I do the same in
postgres?
Madhavi
From | Date | Subject | |
---|---|---|---|
Next Message | Malghan, Ravi | 2003-02-25 12:56:28 | Can postgresql be run in memory (like a memory resident program) |
Previous Message | Kolus Maximiliano | 2003-02-25 11:30:49 | Re: how do i avoid multiple sessions from inserting the |