X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A6AEE5284D for ; Sat, 25 Jun 2005 03:40:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36133-07 for ; Sat, 25 Jun 2005 06:40:24 +0000 (GMT) Received: from biglumber.com (biglumber.com [207.228.252.42]) by svr1.postgresql.org (Postfix) with SMTP id 86CD25280D for ; Sat, 25 Jun 2005 03:40:20 -0300 (ADT) Received: (qmail 10789 invoked from network); 25 Jun 2005 06:40:21 -0000 Received: from unknown (HELO localhost) (207.228.252.42) by 0 with SMTP; 25 Jun 2005 06:40:21 -0000 From: "Greg Sabino Mullane" To: tfo@sitening.com Cc: pgsql-sql@postgresql.org Cc: pgsql-sql@postgresql.org Subject: Re: Grouping Too Closely X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: <62592AAD-20CB-42EC-B599-E1D42D16A7BC@sitening.com> Date: Sat, 25 Jun 2005 06:40:21 -0000 X-Mailer: JoyMail 1.48 Message-ID: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.22 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200506/299 X-Sequence-Number: 21900 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > This doesn't give me quite what I'm looking for because I need there > to be only one of each possible value of seq2 to be returned for each > value of fkey. Then perhaps just: SELECT fkey, seq2, min(seq1) FROM my_table WHERE seq2 > 2 GROUP BY fkey, seq2 ORDER BY 1,2,3; - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200506250237 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFCvPwJvJuQZxSWSsgRAtcHAKDzl67Va8ABP4qyNpvFtWDpjmT/iwCg3D5J kJMkDaELNZREh5+7OyJ/FSU= =SChT -----END PGP SIGNATURE-----