Re: SQL group select question

From: "Ramakrishnan Muralidharan" <ramakrishnanm(at)pervasive-postgres(dot)com>
To: "Dave Roe" <davidroe(at)email(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SQL group select question
Date: 2005-04-19 05:03:17
Message-ID: 02767D4600E59A4487233B23AEF5C59922C28F@blrmail1.aus.pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

The following SQL query will fetch you result based on the example given below,

SELECT T.ID , T.VALUE FROM ( SELECT MAX( NUMB ) AS NUMB , NAME FROM TEST3 GROUP BY NAME ) AS A , TEST3 T
WHERE A.NAME = T.NAME AND A.NUMB = T.NUMB
ORDER BY T.ID DESC

Regards,
R.Muralidharan

Browse pgsql-sql by date

  From Date Subject
Next Message Ramakrishnan Muralidharan 2005-04-19 07:12:45 Re: SQL subquery (count distinct) - Any Ideas?
Previous Message Michael Fuhr 2005-04-19 04:50:17 Re: "pltcl" function.