How to remove the second repetition of combination in mySQL
Try this

DELETE n1
    FROM tablename n1, tablename n2
    WHERE n1.id &gt; n2.id
      AND n1.exam = n2.exam
      AND n1.name = n2.name
      AND n1.subject = n2.subject