Hi Here i came across a situation in which by mistakenly Without dropping the table i have run the batch file of the table which consists of some insert statements in detail
Following query will give you all records that you want to keep:
SELECT min(id)
FROM alert_priority
GROUP BY priority_name
HAVING count(*) > 1
OR min(id) = max(id)
To remove all duplicates, run this query:
DELETE FROM alert_priority
WHERE id NOT IN (
SELECT min(id)
FROM alert_priority
GROUP BY priority_name
HAVING count(*) > 1
OR min(id) = max(id)
)