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: Bippie <no.spam_at_for.me>
Date: 5 Jun 1998 08:09:41 GMT
Message-ID: <6l8945$3a3$1@hdxf08.telecom.ptt.nl>

This one should work too:

select *
from friend
MINUS
select F.name, F.state
from friend F,customer C
where F.name = C.name;

mpir_at_compuserve.com schrijfbewerkingen: > 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 - 03:09:41 CDT

Original text of this message

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