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: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 24 Feb 2004 07:41:19 -0800
Message-ID: <1077637242.282655@yasure>


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.
>
> simple SQL problem:
> clients, which some of them haves orders. Now I would like to have all
> clients which have either no orders or orders which have a total price
> less than 10$
> (something like this, is not so important...)
>
> SELECT * FROM client LEFT JOIN order ON (client.id = order.clientid
> and order.price < 10.0)
>
> I have an and clause in my LEFT JOIN. How would this be look like in
> oracle ?
>
> SELECT * FROM client, order WEHER client.id = order.clientid(+)
> and order.price < 10.0
>
> is not working because in this case I loose clients which have no
> orders
> so any ideas how to realize that ?
>
> thank you for your time.
>
> regards
> Mark

http://www.psoug.org/reference/joins.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Feb 24 2004 - 09:41:19 CST

Original text of this message

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