同桌上课用手指进去了好爽_欧美丰满熟妇xxⅹⅹ性大i_成人av天天日天天拍拍_猛男gay帅男gay男男同志_欧美va天堂在线观看_人妻无码av中文系列三里桃花_亚欧免费无码在线观看_久久久精品国产亚洲av水_日韩在线免费看污污污_2021无码专区人妻系列日韩

首頁(yè) 優(yōu)化推廣 常見對(duì)sql重復(fù)記錄操作命令

常見對(duì)sql重復(fù)記錄操作命令

來源: | 時(shí)間:2010/12/21 13:09:41 |


select distinct name from table  選擇name字段無重復(fù)記錄的的數(shù)據(jù),但是只能選擇比較的字段,多個(gè)別的字段則無效

select min(id) as id,name from table group by name  選擇name字段無重復(fù)記錄的的數(shù)據(jù),可以同時(shí)選擇其它字段

select * from table where id not in(select min(id) from table group by name)  選擇name字段重復(fù)記錄的的數(shù)據(jù),每一條記錄保留一條后顯示出來的,也就是多余的記錄,可以刪除的

delete from table where id not in(select min(id) from table group by name)  刪除所有重復(fù)記錄(重復(fù)記錄中只留下ID最小的該條記錄)

select * from table where name in(select name from table group by name having count(name)>1)  選擇name字段有重復(fù)記錄的的數(shù)據(jù),比如某個(gè)記錄出現(xiàn)了3次,著三次都在這個(gè)選擇結(jié)果中

select * from table where name like"%河北包裝印刷網(wǎng)%"選擇所有name為河北包裝印刷網(wǎng)的記錄,注意:此句中雙引號(hào)應(yīng)該為單引號(hào)

服務(wù)熱線

153 8323 9821

功能和特性

價(jià)格和優(yōu)惠

網(wǎng)站和維護(hù)

推廣和優(yōu)化

微信服務(wù)號(hào)