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: Simple How To: SQL left Join with and clause

Re: Simple How To: SQL left Join with and clause

From: Andreas <anonmeg_at_start.no>
Date: Tue, 24 Feb 2004 23:20:24 +0100
Message-ID: <K8Q_b.1540$EV2.7600@amstwist00>


Daniel Morgan wrote:

> Andreas wrote:
>

>> joes wrote:
>>
>>> Hello there
>>> I try to rewrite an Access queries for Oracle 8. Now I get in touch
>>> with 'LEFT JOIN' and need there some little hint how to do that.

>
>
>> You don't need to rewrite that much.  Left join are ANSI standard, so 
>> this sould be valid.
>> SELECT *
>> FROM client LEFT JOIN order
>>   ON (client.id = order.clientid)
>> WHERE order.price < 10.0;

>
>
> Did you read what the OP wrote? Notice he said "for Oracle 8". What
> you posted will not work in any version or edition of Oracle 8.
>

Sorry

But the part about comparing order.price to null should still apply. I think this SQL should solve his problem in 8i as well...

SELECT *
FROM client, order
WHERE client.id = order.clientid(+)

   AND (order.price < 10.0 OR order.clientid IS NULL);

(same as in my last post...)

Andreas Received on Tue Feb 24 2004 - 16:20:24 CST

Original text of this message

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