摘要: Mysql 删除表重复记录,当有多条重复记录时,保存最新记录。 方法一、 delete from IP where ip_id in (select * from (select max(ip_id) as ip_id from IP group by ip_name having count(ip_id)>1) as a) 方法二、 delete IP as a from I... 阅读全文
posted @ 2012-07-18 14:53 yixiong 阅读(128) 评论(0) 推荐(0) 编辑
摘要: SELECT ip_name,count(ip_name) as ipcount from IP GROUP BY ip_name where ipcount >1;本以为可以像在MSsql一样现在,发现不行,下面是在Mysql方法SELECT ip_name,count(ip_name) as ipcount from IP GROUP BY ip_name having count(ip_... 阅读全文
posted @ 2012-07-18 11:42 yixiong 阅读(347) 评论(0) 推荐(0) 编辑