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: Jonathan Gennick <jonathan_at_gennick.com>
Date: Sat, 01 May 1999 02:11:39 GMT
Message-ID: <373c5efc.10731135@netnews.worldnet.att.net>


If you are using an Oracle DATE field for the date, you should be able to use MAX:

	SELECT id, max(date)
	from table
	group by id;

The date format is a display issue, and has no effect on how the date is evaluated by MAX.

Jonathan

On Fri, 30 Apr 1999 12:22:56 +0100, "Matt Randle" <matt_at_imat.demon.co.uk> wrote:

>We have a table that is keyed on a unique ID + a Date Time value. Using
>Oracle SQL is there any way of finding the most recent assignments by ID.
>
>For example, if the table was populated as follows (British dates),
>
>ID Date Time + Additional Columns
>
>1 1/1/99
>1 5/3/99
>1 6/4/99
>2 4/4/99
>2 28/5/99
Received on Fri Apr 30 1999 - 21:11:39 CDT

Original text of this message

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