Get the data when there is no Primary key in table

  • Hi,

    I have two tables with same kind of structure [datatype]. Both the tables has 20 columns each. Moreover, there is no Primary key on these tables. One table has 10 rows and another table has 5 rows. What my question is, how to compare both the tables? I want to get the list of rows that not having in table2 when compare to table1.

    Normally, we used to use JOIN to get the datas. We will give Primary key Column when comparing tables. For my understanding, One solution is we need to put all the 20 Column in ON Clause to compare these table. Is it any easy way other than this?

    Appreciate your help!

    ---

  • SELECT * FROM table1

    except

    SELECT * FROM table2

    -Vikas Bindra

  • Oh... yes, thanks you very Vikas! 🙂

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply