Re: [SQL] Subsorting GROUP BY data

2008-11-10 Thread Johnson, Michael L.
Thanks! That's perfect, because now I don't need the FIRST/LAST aggregate functions! Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fernando Hevia Sent: Monday, November 10, 2008 10:30 AM To: Johnson, Michael L.; pgsql-sql@postgresql.o

[SQL] Subsorting GROUP BY data

2008-11-10 Thread Johnson, Michael L.
Given the following table: ID | Cat | Num |---|-- Z | A | 0 Y | A | 1 X | A | 2 W | B | 0 V | B | 1 U | B | 2 T | C | 0 S | C | 1 R | C | 2 I want to do this: Group the items by the cat field. Then select th