Re: Generating a range of integers in a query

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Generating a range of integers in a query
Дата
Msg-id 053899DD-536A-4B3F-87B0-8961FDD38315@myrealbox.com
обсуждение исходный текст
Ответ на Generating a range of integers in a query  (Aaron Bingham <bingham@cenix-bioscience.com>)
Список pgsql-sql
On Jul 13, 2005, at 6:13 PM, Aaron Bingham wrote:

> This would be easy (in my case at least) if there were a way to
> generate a table containing all integers between 1 and n, where n is
> the result of a subquery.  In my case, n will be at most a few
> hundred.  I would like to be able to generate this table as a
> subquery.  Any ideas?

Take a look at generate_series(), available in v8.0 and above.

http://www.postgresql.org/docs/8.0/interactive/functions-srf.html


Michael Glaesemann
grzm myrealbox com




В списке pgsql-sql по дате отправления:

Предыдущее
От: Aaron Bingham
Дата:
Сообщение: Generating a range of integers in a query
Следующее
От: "Graham Vickrage"
Дата:
Сообщение: Re: Copy user privileges