Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Grouping by record with the latest date
Wed, Feb 4 2009 10:34 PMPermanent Link

"Al Vas"
Hi,

I have a table as follows:

Category, Date
A     13/01/08
A     15/01/08
B     11/01/08
C     11/01/08
C     19/01/08
C     14/01/08

I want to for each group A,B,C end up with a result set that has just one
record per categroy which contains the record with the latest date.

Help appreciated.

Alex
Thu, Feb 5 2009 9:48 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Alex

What's the complete structure (at least the columns you want in the
result set) and Primary Key of this table?

--
Fernando Dias
[Team Elevate]
Thu, Feb 5 2009 2:09 PMPermanent Link

"G Patena"
select Category, max(date) as LatestDate
from YourTable
group by Category


"Al Vas" <noreply@noreply.com> wrote in message
news:262A9D24-AE12-4120-A95C-7801E16AC546@news.elevatesoft.com...
> Hi,
>
> I have a table as follows:
>
> Category, Date
> A     13/01/08
> A     15/01/08
> B     11/01/08
> C     11/01/08
> C     19/01/08
> C     14/01/08
>
> I want to for each group A,B,C end up with a result set that has just one
> record per categroy which contains the record with the latest date.
>
> Help appreciated.
>
> Alex

Image