Compare 2 table columns, urgent help!!

Last Post 24 Mar 2009 07:58 PM by sqlserverdeveloper. 0 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
New Member
New Member

24 Mar 2009 07:58 PM
Below is my requirement, 2 tables(table1,table2) have same number of columns and same datatype.

For example:
empID LastName FirstName
1 Michael Tom
2 Wacko Mark
3 Brad Gates

empID LastName FirstName
1 Michelle Tom
2 Yo-Yo Mark
3 Brad Ma

From the above tables when I pass empID as a parameter: I should get the following
output, only the columns with different values need to be displayed from both the tables:

output for for empId:1
empID LastName
1 Michael
1 Michelle

output for for empId:3
empID FirstName
3 Gates
3 Ma

Please let me know. Thanks.

Acceptable Use Policy