Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #531 > unrolled thread

How to select val from range of integers

Started byjacki <collector@idealan.pl>
First post2014-01-15 09:42 +0100
Last post2014-01-15 10:10 +0100
Articles 3 — 2 participants

Back to article view | Back to comp.databases.postgresql


Contents

  How to select val from range of integers jacki <collector@idealan.pl> - 2014-01-15 09:42 +0100
    Re: How to select val from range of integers Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2014-01-15 10:05 +0100
      Re: How to select val from range of integers jacki <collector@idealan.pl> - 2014-01-15 10:10 +0100

#531 — How to select val from range of integers

Fromjacki <collector@idealan.pl>
Date2014-01-15 09:42 +0100
SubjectHow to select val from range of integers
Message-ID<lb5hmb$oug$1@news.task.gda.pl>
Hi,

How can i select val from range of integers, something like:

SELECT VAL FROM (VALUES(1), (2), (3), ..., (10000));

I want to write a query which will return me values that are not exists 
in given table row.

For examle:

id, name
--------
1, a
2, b
4, c
6, d
7, e
8, f

I need to get: id=3 and id=5

Cheers!

[toc] | [next] | [standalone]


#532

FromDimitri Fontaine <dimitri@2ndQuadrant.fr>
Date2014-01-15 10:05 +0100
Message-ID<m2txd5ty28.fsf@2ndQuadrant.fr>
In reply to#531
jacki <collector@idealan.pl> writes:
> How can i select val from range of integers, something like:
> SELECT VAL FROM (VALUES(1), (2), (3), ..., (10000));

See generate_series().

Regards,
-- 
Dimitri Fontaine
PostgreSQL DBA, Architecte

[toc] | [prev] | [next] | [standalone]


#533

Fromjacki <collector@idealan.pl>
Date2014-01-15 10:10 +0100
Message-ID<lb5j9m$r2p$1@news.task.gda.pl>
In reply to#532
W dniu 2014-01-15 10:05, Dimitri Fontaine pisze:
> jacki <collector@idealan.pl> writes:
>> How can i select val from range of integers, something like:
>> SELECT VAL FROM (VALUES(1), (2), (3), ..., (10000));
>
> See generate_series().
>

Thank You very much, works perfectly!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.postgresql


csiph-web