In response to Erwin Moller :
> Hi,
> 
> Is it possible to create a range of dates or numbers inside a query 
> without wrining in procedural language?
> I am looking for something that creates some kind of 'temp table' inside 
> a query.
> eg:

generate_Series():

test=# select * from generate_Series(1,5);
 generate_series
-----------------
               1
               2
               3
               4
               5
(5 rows)

test=*# select current_date + s * '1day'::interval  from
generate_Series(1,5)s;
      ?column?
---------------------
 2008-12-20 00:00:00
 2008-12-21 00:00:00
 2008-12-22 00:00:00
 2008-12-23 00:00:00
 2008-12-24 00:00:00
(5 rows)


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to