How to keep only one row of a table, removing duplicate rows?

0
73

show record 
SELECT page_url,count() FROM wl_meta_tags GROUP BY page_url HAVING count() > 1

delete record 
DELETE FROM wl_meta_tags WHERE meta_id NOT IN( SELECT meta_id FROM ( SELECT MIN(meta_id)AS meta_id FROM wl_meta_tags GROUP BY page_url HAVING COUNT() > 1 )AS a ) AND meta_id NOT IN( (SELECT ids FROM ( SELECT MIN(meta_id)AS ids FROM wl_meta_tags GROUP BY page_url HAVING COUNT() =1 )AS a1 ) )

LEAVE A REPLY

Please enter your comment!
Please enter your name here