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 -> [SQL] how to avoid an inner join

[SQL] how to avoid an inner join

From: Harald Fischer-Hohlweck <Harald.Fischer-Hohlweck_at_ibix.de>
Date: Mon, 17 Sep 2001 15:46:22 +0200
Message-ID: <9o4urg$2c1n$1@news.lf.net>


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-414
Received on Mon Sep 17 2001 - 08:46:22 CDT

Original text of this message

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