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: <chris.hulan_at_gmail.com>
Date: 14 Jul 2006 08:05:28 -0700
Message-ID: <1152889528.853487.316780@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:05:28 CDT

Original text of this message

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