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 -> How do I retrieve just the latest record in a Table ?

How do I retrieve just the latest record in a Table ?

From: Bruce Messer <bwm_at_globalnet.co.uk>
Date: Sun, 16 Aug 1998 18:12:47 +0100
Message-ID: <6r7408$j5h$1@heliodor.xara.net>


Hi

I am writing a query in Delphi 4 to an Oracle 8 database. At the moment its simply

Select * from Table
Where rec='EGLL'
Or rec='EGQS'
Or rec='EGQL'
etc etc....
Order by Report_Time (this a datetime field)

The thing is there can be as many as 8 reports for each record (rec) and this query will bring them all back for each rec in report_time order. What I really want is to just bring back a single 'latest recieved' record back for each one.
Can I filter out the latest record without bringing in the report_time into it (i.e. by saying 'Where report_time>1300') ???

Thanks in anticipation

Bruce. Received on Sun Aug 16 1998 - 12:12:47 CDT

Original text of this message

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