pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gergely Czuczy <phoemix@harmless.hu>
To: Kenneth Suralta <ksuralta@ntsp.nec.co.jp>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: help on SQL
Date: Wed, 21 Apr 2004 09:09:26 +0200 (CEST)
Message-ID: <Pine.LNX.4.44.0404210907250.28604-100000@localhost> (raw)
In-Reply-To: <40861D9B.10403@hq.ntsp.nec.co.jp>

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@harmless.hu
PGP: http://phoemix.harmless.hu/phoemix.pgp

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




view thread (8+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0404210907250.28604-100000@localhost>
Permalink:  ../Pine.LNX.4.44.0404210907250.28604-100000@localhost/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0404210907250.28604-100000@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: phoemix@harmless.hu, ksuralta@ntsp.nec.co.jp
  Subject: Re: help on SQL
  In-Reply-To: <Pine.LNX.4.44.0404210907250.28604-100000@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox