Re: help on SQL - Mailing list pgsql-interfaces

From Gergely Czuczy
Subject Re: help on SQL
Date
Msg-id Pine.LNX.4.44.0404210941480.16994-100000@localhost
Whole thread Raw
In response to Re: help on SQL  (Kenneth Suralta <ksuralta@ntsp.nec.co.jp>)
List pgsql-interfaces
ahh, i see, you need every Nth result from the given query.
I think there is no way for this, but getting all the result and dropping
from the client every not-Nthm but i may be wrong

On Wed, 21 Apr 2004, Kenneth Suralta wrote:

> hi gergely,
>
> thanks for replying..
> what i mean is supposing there is a table with the following rows:
>
>  data
> -----
> 1
> 2
> 3
> 4
> 5
> 6
> 7
>
> is it possible to get every other N-row in the table?
> example, if N is 3.
> data
> -----
> 1
> 4
> 7
>
> thanks,
> kenneth
>
>
>
> Gergely Czuczy wrote:
>
>  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..."
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
>
>
>
> --
> [IMAGE]
>
>


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..."



pgsql-interfaces by date:

Previous
From: Kenneth Suralta
Date:
Subject: Re: help on SQL
Next
From: Michael Stephenson
Date:
Subject: Re: help on SQL