Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky SQL Problem

Re: Tricky SQL Problem

From: N.R. van den Berg <rvdberg_at_spam.vx8000.com>
Date: Thu, 6 May 1999 12:37:24 +0100
Message-ID: <7grrh1$qjf$1@news.news-service.com>


This surely 'll do the trick:
Select T2.id_column

,            T2.date_column
,            T2.additional_column1
,             T2.additional_columnN
from     (Select id_column, max(date_column) date_column
              from TABLE
             group by id) T1
,            TABLE T2
where  T2.id_column=T1.id_column
and      T2.date_column=T1.date_column

order by T2.id_column;

--
> _____________________________________________
> VX8000 B.V.
> Business IT
>
> Ir N.R. van den Berg
> E-mail: mailto:rvdberg_at_vx8000.com
> Web : http://www.vx8000.com
> _____________________________________________
>

Matt Randle wrote in message
<925474592.23218.0.nnrp-07.d4e48d0d_at_news.demon.co.uk>...
>The query works but I can't get it to return additional columns. If I try
>to include the names of the additional columns in the select clause the
>group by statement won't work.
>
>Thanks,
>
>Matt.
>
>
>
>
Received on Thu May 06 1999 - 06:37:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US