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: How to get latest date

Re: How to get latest date

From: June Tong <june_t_at_hotmail.com>
Date: Fri, 15 Jan 1999 17:16:20 -0800
Message-ID: <77op1q$348$1@news-1.news.gte.net>


Or, assuming you wanted to get the whole row for 31-Jan-99, rather than just the date,

SELECT * FROM table
  WHERE date_column = (SELECT MAX (date_column) FROM table)

June

Jeremy Russell wrote:

> Try select min(date_column), max(date_column) from table
>
> And look up aggregate / group queries in the Oracle manuals.
>
> JR
>
> adrianh_at_globalnet.co.uk (Adrian Harrison) wrote:
>
> >This is probably a very simple question but I can't work out how to do it!
> >
> >I have to write a sql statement that returns just one record from a table based on a date field
> >
> >I need to be able to pick the latest/earliest date!
> >
> >e.g
> >
> > 15-Jan-99
> > 31-Jan-99
> > 01-Jan-99
> >
> >How can I just return 31-Jan-99 or 01-Jan-99?
> >
> >Thanks
> >
> >Adrian harrison
> >
Received on Fri Jan 15 1999 - 19:16:20 CST

Original text of this message

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