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 -> Re: Help with a SQL statement please...

Re: Help with a SQL statement please...

From: harry <a_at_abc.com>
Date: Fri, 14 Jul 2006 15:09:42 GMT
Message-ID: <WsOtg.101372$wl.66336@text.news.blueyonder.co.uk>


thanks for that Chris, works perfectly!

<chris.hulan_at_gmail.com> wrote in message news:1152889528.853487.316780_at_75g2000cwc.googlegroups.com...
> harry wrote:
> > I have 2 tables, CUSTOMER & CONTACT - CUSTOMER has a primary key field
> > called ID, CONTACT has a foreign key to it called CUST_ID
> >
> > I want to select all rows from CUSTOMER that don't have any CONTACT
rows -
> > i.e. customers with no contacts!
> >
>
> select * from customer
> where id not in (select cust_id from contact)
>
> cheers
>
Received on Fri Jul 14 2006 - 10:09:42 CDT

Original text of this message

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