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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query to get Max (Date)

Re: SQL Query to get Max (Date)

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 7 Feb 2002 13:41:12 -0000
Message-ID: <3c6283fc$0$8510$ed9e5944@reading.news.pipex.net>


This looks like homework but none the less

SQL> select * from t1;

NAMEFIELD DATEFIELD

---------- ---------
niall      07-FEB-02
niall      08-FEB-02
laura      06-FEB-02

SQL> select namefield,max(datefield)
  2 from t1
  3* group by namefield
SQL> / NAMEFIELD MAX(DATEF

---------- ---------
laura      06-FEB-02
niall      08-FEB-02

SQL> HTH

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
"Mike Haig" <zzz_at_postmaster.co.uk> 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
>
> Tony
Received on Thu Feb 07 2002 - 07:41:12 CST

Original text of this message

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