I have two Tables say Table-A and Table-B having same table structure (means number of columns are same) and having same number of Records with same Primary key value.
It is having Column-Id data is same in both the tables but some columns values are Different.
Now I want a Select query which will return those columns only which are having different data in Tables-A and Table-B
Example :
Table-A
ID Name RollNo Status
1 Gourav 22 1
Table-B
ID Name RollNo Status
1 Gourav 24 0
OUTPUT Required is :
Table-C
Id RollNo-A RollNo-B sts-A sts-B
1 22 24 1 0
Please suggest.
Please provide Solution in Sql 2000
This might work.