Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> [SQL] how to avoid an inner join
Hi.
Assume a table having a key Key and a column ValidFrom (ValidFrom is a date). All rows with a definite Key have different ValidFrom's. Can I get the row with the youngest ValidFrom in the past (i.e. the row that is valid actually) without an inner join? Something like
select * from table
where Key = value and ValidFrom = "max(ValidFrom) <= today";
I'm no database expert, but I anticipate performance problems if I have to do the inner join.
Sincerely
Harald
-- Harald Fischer-Hohlweck mailto:Harald.Fischer-Hohlweck_at_ibix.de IBIX Informationssysteme GmbH http://www.ibix.de Vor dem Lauch 19 fon : +49-711-7256-324 70567 Stuttgart (Germany) fax : +49-711-7256-414Received on Mon Sep 17 2001 - 08:46:22 CDT