Results 1 to 2 of 2

Thread: Regarding SQL Server joins

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Regarding SQL Server joins

    Hi All,
    I have two tables. Asume those two tables are as Table1 and Table2.

    Table 1 and table 2 have same no of columns and have same values also. the Only Difference is Table1 contains some extra rows than Table2. Briefly i can say Table 1 is the super set of Table2.

    For example: Tbale2 contains 7 Rows. and the Table1 contains 10 Rows. This is nothing but, Table 1 contains Table2's rows + 3 extra rows.

    Now i want to find those(3) rows which are in Table1 but not in table2.

    could you please suggest me how to solve it? can i use any joins?

    Thanks & Regards,
    raghunadhs

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Regarding SQL Server joins

    SELECT field1,field2,field3 FROM Table1 WHERE NOT EXISTS
    (SELECT id FROM Table2 WHERE Table2.id = Table1.id)

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