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 in multiple rows, just not in different columns in the same row.
Can anyone suggest the best way to get rid of these duplicates?