X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B8937D1B50F for ; Sat, 13 Sep 2003 18:17:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 65874-03 for ; Sat, 13 Sep 2003 15:17:08 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 2CD8ED1B538 for ; Sat, 13 Sep 2003 15:16:56 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 42CB41025A; Sat, 13 Sep 2003 14:08:32 -0400 (EDT) Received: from [192.168.1.200] (dyn-133-150.tor.dsl.tht.net [134.22.133.150]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 831D010248; Sat, 13 Sep 2003 14:08:29 -0400 (EDT) Subject: Re: Q: select query From: Rod Taylor To: "G. Ralph Kuntz, MD" Cc: pgsql-sql@postgresql.org In-Reply-To: <9881c752.0309120958.454c659c@posting.google.com> References: <9881c752.0309120958.454c659c@posting.google.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-r2bdrmzfHReo6+Owmfix" Message-Id: <1063477035.66715.7.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 13 Sep 2003 14:17:16 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/107 X-Sequence-Number: 15085 --=-r2bdrmzfHReo6+Owmfix Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > in other words, all but the first row of a group. Interesting question. The below should work and be quick so long as there is a UNIQUE(col1, col2) constraint. SELECT col1 , col2 FROM j WHERE col2 !=3D (SELECT col2 FROM j AS jsub WHERE col1 =3D j.col1 ORDER BY col2 ASC LIMIT 1); --=-r2bdrmzfHReo6+Owmfix Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/Y18q6DETLow6vwwRAgWBAJ0TMSSm6yAYBZCDDeFuzkR9adwXGACeNHb7 cA6eL3Hpev996cKKpCHy1nM= =1rGU -----END PGP SIGNATURE----- --=-r2bdrmzfHReo6+Owmfix--