Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query to get Max (Date)
zzz_at_postmaster.co.uk (Mike Haig) wrote in message news:<ea1237b2.0202070335.6194b70_at_posting.google.com>...
> Hello, I need some help in creating a query please. I have the two tables below;
>
>
> Table 1:
>
> NameField
>
>
> Table2
>
> Namefield
> Datefield
> Message
>
> I want to get this result:
>
> Name, DateField (the datefield of the last posted message for each name).
>
> Can anyone help with this query?
>
> Thanks
>
select name, datefield
from table2 x
where datefield = (select max(datefield)
from table2 y where y.name = x.name )
Hth
Sybrand Bakker
Senior Oracle DBA
> Tony
Received on Thu Feb 07 2002 - 07:41:15 CST
![]() |
![]() |