首页 > 数据库技术 > 详细

醉了,mysql的删除居然变得这么麻烦 delete from table where id in()

时间:2015-01-07 11:02:17      阅读:396      评论:0      收藏:0      [点我收藏+]

居然要加这么多层,还需要在里面加一个别名才可以。

删除标题重复的旧记录。

delete from theTable where id in
(
	select id from 
	(
		select min(id) id from theTable group by title HAVING count(*)>1
	) ids
) ;


醉了,mysql的删除居然变得这么麻烦 delete from table where id in()

原文:http://blog.csdn.net/miw__/article/details/42487615

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!