X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 46B3BD1B507 for ; Wed, 21 Apr 2004 04:08:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 24150-03 for ; Wed, 21 Apr 2004 04:08:21 -0300 (ADT) Received: from marvin.harmless.hu (marvin.harmless.hu [195.70.51.173]) by svr1.postgresql.org (Postfix) with ESMTP id 8A1E8D1BB72 for ; Wed, 21 Apr 2004 04:08:19 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by marvin.harmless.hu (Postfix) with ESMTP id C4534E000373; Wed, 21 Apr 2004 09:09:28 +0200 (CEST) Received: from marvin.harmless.hu ([127.0.0.1]) by localhost (marvin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15066-08; Wed, 21 Apr 2004 09:09:28 +0200 (CEST) Received: from marvin.harmless.hu (marvin.harmless.hu [195.70.51.173]) by marvin.harmless.hu (Postfix) with ESMTP id 8A8F0E000220; Wed, 21 Apr 2004 09:09:28 +0200 (CEST) Date: Wed, 21 Apr 2004 09:09:26 +0200 (CEST) From: Gergely Czuczy X-X-Sender: phoemix@localhost To: Kenneth Suralta Cc: pgsql-interfaces@postgresql.org Subject: Re: help on SQL In-Reply-To: <40861D9B.10403@hq.ntsp.nec.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at harmless.hu X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/49 X-Sequence-Number: 4870 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..."