Home >Database >Mysql Tutorial >sqlserver删除数据冗余,高手请解释下!thank you

sqlserver删除数据冗余,高手请解释下!thank you

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:34:061150browse

思路?大哥你几年级的 看条件 where ConID = t.ConID and len (GeoNo) len (t.GeoNo) 把 Insert into tb_Table (GeoNo,Title,ConID) values ('01','北京','1000') Insert into tb_Table (GeoNo,Title,ConID) values ('0101','海淀区','1000') Insert into tb

思路?大哥你几年级的

 

看条件where ConID=t.ConID andlen(GeoNo)>len(t.GeoNo)

Insert into tb_Table (GeoNo,Title,ConID) values ('01','北京','1000')
Insert into tb_Table (GeoNo,Title,ConID) values ('0101','海淀区','1000')
Insert into tb_Table (GeoNo,Title,ConID) values ('010101','上地','1000')

弄成

Insert into tb_Table (GeoNo,Title,ConID) values ('010101','上地','1000')

这3条的ConID相同,留下GeoNo长度最大的

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn