sql怎样删除重复值
生活随笔
收集整理的這篇文章主要介紹了
sql怎样删除重复值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
SQL 刪除列中的重復值
D name
13 張三
1123 張三
15 李四
17 李四
我要得到的結果是
ID name
13 張三
15 李四
請問要怎么寫
在線等啊
請問具體的語法要怎么寫啊??????? ===================================================== delete from 表
where id not in(select min(id) from 表 group by name )?? //刪除重復名字的記錄
刪除之前請用語句
select *
from 表
where id in(select min(id) from 表 group by name )
查看能保留下來的數據。 eg.delete from T_bbs_subject
where subjectId not in(select min(subjectId) from T_bbs_subject group by clsid )
轉載于:https://www.cnblogs.com/qiantuwuliang/archive/2009/06/03/1495779.html
總結
以上是生活随笔為你收集整理的sql怎样删除重复值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: IE6、IE7、IE8、Firefox通
- 下一篇: VSTS 离线源码版本辅助工具