Results 1 to 5 of 5

Thread: SQL Query

  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Unanswered: SQL Query

    Hi, I want to write a query for following scenario:
    I have two tables A and B. Each has two columns ID, SUPPLIER.
    I want to find out all the ID + SUPPLIER that exists in A and does not exist in B.

    I have Oracle database and am using SQL editor.

    Thanks in advance !!!

  2. #2
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Arrow Solution

    Use the following query

    select a.id, a.supplier from A minus select b.id, b.supplier from B b;

    Thanx and Regards
    Aruneesh

  3. #3
    Join Date
    Sep 2003
    Posts
    1

    Talking Re: Solution

    Use the following query

    select a.id, a.supplier from A minus select b.id, b.supplier from B b;

    Thanx and Regards
    Aruneesh [/SIZE][/QUOTE]

  4. #4
    Join Date
    Sep 2003
    Posts
    2
    Thanks !!!

  5. #5
    Join Date
    Sep 2003
    Location
    Chennai
    Posts
    2

    Re: SQL Query

    [QUOTE][SIZE=1]Originally posted by AnsMe
    Hi, I want to write a query for following scenario:
    I have two tables A and B. Each has two columns ID, SUPPLIER.
    I want to find out all the ID + SUPPLIER that exists in A and does not exist in B.

    I have Oracle database and am using SQL editor.

    select id,supplier from a where
    ( id,supplier) not in
    (select id,supplier from b)

    /

Posting Permissions

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