delete from `table` where id not in ( select * from ( select min(id) from `table` group by colum) as temp);