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: SQL question

Re: SQL question

From: Phill Weiss <weiss_at_cig.mot.com>
Date: 5 Jun 1998 10:57:14 GMT
Message-ID: <6l8iua$onf$1@trotsky.cig.mot.com>


In article <3577487B.53BBB72_at_hotmail.com>, zyber <zybermaniac_at_hotmail.com> writes:
> I have 2 tables:
> FRIEND
> --------------
> NAME STATE
>
> DAVE CA
> MATT TX
> HAL VA
> JAN TX
>
>
> CUSTOMER
> --------------
> NAME OWED
>
> HAL 45.50
> FRANK 12.35
> KEITH 5.15
> JAN 12.10
>
> How do I write SQL statement to list all
> friends who are not my customer?
> (which is Dave and Matt)
>
> I tried this but didn't work:
>
> SELECT F.NAME "NAME", F.STATE "IN"
> FROM FRIEND F, CUSTOMER C
> WHERE F.NAME <> C.NAME;
>
> Thanks in advance,
> Z
>
>
>

--
 Try:
 select f.name from friend f where
 f.name not in
 (select c.name from customer c);

                                                -Phill
-----------------------------------------------------------------------------
"Off the keyboard, through the CPU, out the transceiver, down the rj45 line, across the router, through the Hub, out the gateway. Nothing but net."
Phill Weiss			Motorola Software Competency Center
Voice: +1 847 632 5701		Metrics & Qualitative Analysis Group
FAX: +1 847 632 7521		1501 W. Shure Drive IL27-3G6
email: CEMX13_at_email.mot.com	Arlington Heights, IL  60004
WWW: http://www.cig.mot.com/~weiss
Received on Fri Jun 05 1998 - 05:57:14 CDT

Original text of this message

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