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.
| Author |
Topic |
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2009-11-23 : 12:04:18
|
| Some contact records in our Contact Table have duplicate data stored in their match_code field. I would like to identify these records so that I can update the match_code to make them unique.I know there are other ways to show uniqueness, but I need to use this match_code column.Any ideas...?select * from Contactwhere match_code = ?? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-23 : 12:06:57
|
do you mean this?SELECT *FROM(SELECT ROW_NUMBER() OVER (PARTITION BY match_code ORDER BY <any other unique valued column>) AS Seq,*FROM table )tWHERE Seq >1 |
 |
|
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2009-11-23 : 12:44:18
|
| Yes, very cool!Thank you.... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-23 : 12:45:15
|
welcome |
 |
|
|
|
|
|