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

Re: help on SQL

From: Gergely Czuczy <phoemix(at)harmless(dot)hu>
To: Kenneth Suralta <ksuralta(at)ntsp(dot)nec(dot)co(dot)jp>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: help on SQL
Date: 2004-04-21 07:09:26
Message-ID: Pine.LNX.4.44.0404210907250.28604-100000@localhost (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Wed, 21 Apr 2004, Kenneth Suralta wrote:

>
> hello everyone,
>
> is it possible to get every other row in the table?
> like for example:
> data
> -----
> 1
> 2
> 3
> 4
> 5
> 6
> 7
SELECT t.fields FROM table t WHERE data NOT IN (SELECT t2.data FROM table
 t2 WHERE some_whereclause);

it will select these rows which ones are not in the subquery. but you can
do it simply by getting the negate of the whereclause...
>
> Is it possible to have this result (interval of 3)?
>
> result
> ------
> 1
> 4
> 7
i don't see what you mean. please describe it.
>
> thanks,
> kenneth
>
> --
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


Bye,

Gergely Czuczy
mailto: phoemix(at)harmless(dot)hu
PGP: http://phoemix.harmless.hu/phoemix.pgp

"Wish a god, a star, to believe in,
With the realm of king of fantasy..."


In response to

  • help on SQL at 2004-04-21 07:07:07 from Kenneth Suralta

Responses

pgsql-interfaces by date

Next:From: Gergely CzuczyDate: 2004-04-21 07:42:31
Subject: Re: help on SQL
Previous:From: Kenneth SuraltaDate: 2004-04-21 07:07:07
Subject: help on SQL

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