Results 1 to 4 of 4

Thread: SQL - MINUS

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    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.

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
    [email protected]
    [email protected]



  3. #3
    Junior Member
    Join Date
    Jul 1999
    Posts
    25

    Post

    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).]

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    Thanks for all your help. Thks all of you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width