| От | Scott Marlowe |
|---|---|
| Тема | Re: Generating a range of integers in a query |
| Дата | |
| Msg-id | 1121273670.8208.251.camel@state.g2switchworks.com обсуждение исходный текст |
| Ответ на | Generating a range of integers in a query (Aaron Bingham <bingham@cenix-bioscience.com>) |
| Список | pgsql-sql |
On Wed, 2005-07-13 at 04:13, Aaron Bingham wrote: > Hello, > > I've got an interesting problem: I need to select all possible values > of an attribute that do /not/ occur in the database. > > 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 here: http://www.postgresql.org/docs/8.0/interactive/functions-srf.html specifically, the generate_series() function.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера