Deleting a duplicate record
Recently a friend of mine asked me about deleting a duplicate record from a table without deleting both records. Having been in a situation I drafted up a sample script and emailed to him. DECLARE @tbl1 TABLE ( id int, color varchar(50) ) INSERT INTO @tbl1 (id, color) VALUES (1,'blue') ,(1,'blue') ,(1,'blue') ,(2,'red') ,(3,'green') ,(4,'yellow') ,(5,'orange'); First off let’s see all the rows in…
View On WordPress















