I have discussed earlier in one of my post how to delete duplicate records from a table . But recently i came up with even shorter way to delete duplicate records.
Consider a StudentInfo Table as shown below for demonstration.
SELECT * FROM StudentInfo
Step1:
First we will create a temporary table '#temp' with same structure as that of original table
'StudentInfo' and insert all distinct rows from the 'StudentInfo' table into temporary table as follows:
Consider a StudentInfo Table as shown below for demonstration.
SELECT * FROM StudentInfo
StudentInfo Table |
First we will create a temporary table '#temp' with same structure as that of original table
'StudentInfo' and insert all distinct rows from the 'StudentInfo' table into temporary table as follows: