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: <mpir_at_compuserve.com>
Date: Fri, 05 Jun 1998 06:24:13 GMT
Message-ID: <6l82ud$pms$1@nnrp1.dejanews.com>


How about

select * from friend
where not exists (select name from customer where customer.name=friend.name);

In article <3577487B.53BBB72_at_hotmail.com>,   zyber <zybermaniac_at_hotmail.com> wrote:
>
> 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
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Fri Jun 05 1998 - 01:24:13 CDT

Original text of this message

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