pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <greg@turnstep.com>
To: tfo@sitening.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Grouping Too Closely
Date: Sat, 25 Jun 2005 06:40:21 -0000
Message-ID: <a053b85772b71eaf158e0354551e72d2@biglumber.com> (raw)
In-Reply-To: <62592AAD-20CB-42EC-B599-E1D42D16A7BC@sitening.com>


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





view thread (5+ messages)

Message-ID: <a053b85772b71eaf158e0354551e72d2@biglumber.com>
Permalink:  ../a053b85772b71eaf158e0354551e72d2@biglumber.com/
Also on:    postgresql.org/message-id/a053b85772b71eaf158e0354551e72d2@biglumber.com

 · 

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-sql@postgresql.org
  Cc: greg@turnstep.com, tfo@sitening.com
  Subject: Re: Grouping Too Closely
  In-Reply-To: <a053b85772b71eaf158e0354551e72d2@biglumber.com>

* 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