Skip site navigation (1) Skip section navigation (2)

Re: Fill array with series

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fill array with series
Date: 2012-03-22 20:02:56
Message-ID: CAFj8pRD98px3qeNn79Kpx9FwTWjYBgDcWrDstbAQOm5wGVgt5A@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hello

no, there is nothing similar.

Regards

Pavel

2012/3/22 Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>:
> Is there a single function that will generate a series and return an array?
> The best I've come up with is to combine array_agg and generate_series:
>
> SELECT array_agg(generate_series) FROM generate_series(5, 23);
>
> array_agg
> ---------------------------------------------------------
> {5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
>
> Thanks,
> --Lee
>
> --
> Lee Hachadoorian
> PhD, Earth & Environmental Sciences (Geography)
> Research Associate, CUNY Center for Urban Research
> http://freecity.commons.gc.cuny.edu/
>

In response to

pgsql-sql by date

Next:From: Edward W. RouseDate: 2012-03-22 20:26:09
Subject: ignore case in where clause
Previous:From: Lee HachadoorianDate: 2012-03-22 19:47:04
Subject: Fill array with series

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group