Results 1 to 3 of 3

Thread: non matching rows display

  1. #1
    Join Date
    Apr 2008
    Posts
    1

    non matching rows display

    Table1

    TopicId TopicName BusinessUnit Rank

    1 T1 BU1 1
    2 T2 BU1 2
    1 T1 BU2 1
    2 T2 BU2 2

    Table2

    TopicId TopicName BusinessUnit Rank

    1 T1 BU1 1
    2 T2 BU2 2

    Here i want to display nonmatching rows from first table.Plz urgent

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Have pkey on those tables?

  3. #3
    Join Date
    Apr 2009
    Posts
    20

    Solution

    select * from table1 t1
    where not exists
    (
    select 1 from table2 t2
    where t1.topicid = t2.topicid and
    t1.topicname = t2.topicname and
    t1.businessunit = t2.businessunit and
    t1.rank = t2.rank
    )

    Regards,
    Srikanth
    SSE,
    OCA.

Posting Permissions

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