pgsql删除重复的数据保留一条

DELETE FROM admin
 WHERE  id in(SELECT max(id) AS min_id FROM adminwhere  ext  like '32%'  GROUP BY num having count(*)>1)

你可能感兴趣的:(数据库)