PDA

Click to See Complete Forum and Search --> : SQL - MINUS


SAMS
Sep 2nd, 1999, 12:33 PM
Hi Guys,

Another question abt SQL, I got two tables and I wanted to find out who is in Q table and not in W table? So I used these code:

Select Name From q Minus Select Vendor From w

Error: Syntax error in From?

Please do correct me if my code is wrong.

Thks.

Serge
Sep 2nd, 1999, 06:50 PM
Try this:


Select Name From Q Left Join W On Q.SomeID = W.SomeID Where W.Name Is Null


SomeID is a field that is common in both tables.

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com

Jamppa
Sep 3rd, 1999, 12:41 PM
or you can use alternatively code as follows:

select Q.Name from Q where Q.Name Not in (select W.Name from W)


Jan

[This message has been edited by Jamppa (edited 09-04-1999).]

SAMS
Sep 5th, 1999, 12:14 PM
Thanks for all your help. Thks all of you