Loading

MySQL单表删除重复列SQL语句

DELETE 
FROM
	video 
WHERE
	url IN ( SELECT id FROM ( SELECT url AS id FROM video GROUP BY url HAVING count( url ) > 1 ) a ) 

AND id NOT IN ( SELECT pid FROM ( SELECT min( id ) AS pid FROM video GROUP BY url HAVING count( url ) > 1 ) b )

posted @ 2022-07-16 15:13  Roc-xb  阅读(4)  评论(0编辑  收藏  举报

易微帮源码


易微帮官网