您的位置:首页 > 其它

删除一个信息表中除id外其他字段都相同的冗余信息

2010-03-11 23:53 701 查看
删除一个信息表中除id外其他字段都相同的冗余信息,如下

id name addr

1 a b

2 a b

3 b c

删除这个表中的冗余信息

即应该是

id name addr

1 a b

3 b c

设table为t

Sql:delete from tableName where id not in (select min(id) from tableName group by name, addr…)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐