Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing two rows in SQL Server

Scenario

A very large size query returns a lot of fields from multiple joined tables. Some records seem to be duplicated. You accomplish some checks, some grouping. You focus on a couple of records for further investigation. Still, there are too much fields to check each value.

Question

Is there any built-in function that compares two records, returning TRUE if the records match, otherwise FALSE and the set of not matching fields?

like image 481
Alberto De Caro Avatar asked Jul 17 '12 09:07

Alberto De Caro


1 Answers

The CHECKSUM function should help identify matching rows

 SELECT CHECKSUM(*) FROM table
like image 79
podiluska Avatar answered Nov 01 '22 06:11

podiluska