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

Simple How To: SQL left Join with and clause

From: joes <joes_at_bluewin.ch>
Date: 24 Feb 2004 00:24:30 -0800
Message-ID: <26760a3e.0402240024.cb53279@posting.google.com>


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 Received on Tue Feb 24 2004 - 02:24:30 CST

Original text of this message

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