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: Complex PL-SQL Query ?

Re: Complex PL-SQL Query ?

From: Martin Doherty <martin.doherty_at_elcaro.moc>
Date: Tue, 19 Nov 2002 13:40:10 -0800
Message-ID: <ahyC9.10$cK2.222@news.oracle.com>


Fred,

You didn't specify your version of Oracle.

Here's a simple query that should work in most versions. (I'm assuming that ASOFDATE is of DATE data type).

select * from cimshist
where asofdate = (select max(asofdate) from cimshist)

hth
Martin Doherty

Fred Zimmerman wrote:

>I have a table CIMSHIST that has fields: hullno, hulltype, location, asofdate.
>
>I can have some data like the following
>
>HULLTYPE HULLNO LOCATION ASOFDATE
>-------- ------ -------- --------
>YOS 33 700012/S 13-APR-95
>YOS 33 700012/S 05-MAY-99
>YOS 33 700012/S 10-JUL-02
>
>
>I only want to return the record with
>latest ASOFDATE.
>
>Can anyone give me the SQL query to handle
>this task?
>
>
Received on Tue Nov 19 2002 - 15:40:10 CST

Original text of this message

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