Finding and removing duplicate column values in a SQL Server row
问题 Yes, another SQL duplicates question :) I have a SQL Server 2008 R2 table with multiple phone number columns, looking something like: ID Tel1 Tel2 Tel3 Tel4 Tel5 Tel6 1 123 456 789 NULL NULL NULL 2 123 456 123 123 NULL NULL 3 456 789 123 456 NULL NULL I'd like to remove the duplicate phone numbers from each row - for example, in row ID 2, I need to NULL Tel3 and Tel4, and in row 3 I need to NULL Tel4. I don't need to check for duplicates between rows - the same phone number can exist between