Method 1
Delete yourtable
where [id] not in (
Select MAX ([id]) from yourtable
Group by (name + Valu) E)
Method 2
Delete a
from table a LEFT join (
Select (ID) from table GROUP by Name,value
) b on A.id=b.id
Where b.id is null
Query and delete duplicate records SQL statements
Query and delete duplicate records SQL statements
1, lookup table redundant records, duplicate records are based on a single field (Peopleid) to determine
SELECT * Fro M people
where Peopleid in (select Peopleid to People group by Peopleid have count (Peopleid) > 1)
2, delete table many Duplicate records, which are based on a single field (Peopleid), leaving only the rowid smallest record
Delete from people
where Peopleid in (select Peopleid from people GROUP BY Peopleid has count (Peopleid) > 1)
and rowID not in (select min (rowid) from people group by Peopleid Ha Ving Tsun count (peopleid) >1)
3, find redundant records in a table (multiple fields)
Select * from Vitae a
where (A.PEOPLEID,A.SEQ) in (select P Eopleid,seq from Vitae GROUP by Peopleid,seq having count (*) > 1)