DELETE from test where test.id not in (SELECT a.id FROM (select MAX(t1.id) as id from test t1 ,test t2 where t1.name=t2.name and t1.value=t2.value) a) ;
DELETE from test where test.id not in (SELECT a.id FROM (select MAX(t1.id) as id from test t1 ,test t2 where t1.name=t2.name and t1.value=t2.value) a) ;