Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Comparison Query

Author  Topic 

Programmer_110
Starting Member

1 Post

Posted - 2012-06-27 : 19:34:39
I am new to SQL server, I have a table in the following format:

Colum1 colum2 colum3..
Name0_1 a b
Name1_1 W g
Name2_1 aa bb
Name3_1…..
Name0_2 a b
Name1_2 W g
Name2_2 aa bb
Name3_2…..

there are close to 50 columns and a few 100 rows. The data in the columns for Namex_1 should match with Namex_2

I want to write a query that should flags all the name where a mismatch is obtained between _1 and _2 data and also the column where the mis match is encountered. Like in the example above Name1_1 should be flagged for Column1. Any ideas?

Thank you
   

- Advertisement -