Sunday 10 November 2013

How can we delete duplicate duplicate information in sql server

DELETE
FROM  sheet1$
WHERE sheet1$.%%lockres%%
      NOT IN (SELECT MIN(b.%%lockres%%)
              FROM   sheet1$ b
              GROUP BY b.candidatecode, b.candidatename, b.currentyrsem, b.stream, b.streamsubject, b.subject, b.subjectcode, b.subjecttype, b.theorymarks, b.iamarks, b.theoryminmarks, b.theorymaxmarks, b.iaminmarks, b.iamaxmarks, b.credits, b.centername, b.result, b.collaboratorname)
             

Sheet1$ is a table name and candidatecode, candidatename, currentrysem, stream and all are the coloumn name of table......