锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产∨亚洲V天堂无码久久久,亚洲一区二区三区高清在线观看 ,亚洲国语精品自产拍在线观看http://www.tkk7.com/luofeng225/category/38589.html鐢熶簬蹇ф偅錛屾浜庡畨涔愩?/description>zh-cnSat, 06 Jun 2009 01:42:33 GMTSat, 06 Jun 2009 01:42:33 GMT60鍐呰繛鎺ワ紝澶栬繛鎺ワ紝鑷劧榪炴帴http://www.tkk7.com/luofeng225/archive/2009/06/02/279717.htmlluofeng225luofeng225Tue, 02 Jun 2009 15:24:00 GMThttp://www.tkk7.com/luofeng225/archive/2009/06/02/279717.htmlhttp://www.tkk7.com/luofeng225/comments/279717.htmlhttp://www.tkk7.com/luofeng225/archive/2009/06/02/279717.html#Feedback0http://www.tkk7.com/luofeng225/comments/commentRss/279717.htmlhttp://www.tkk7.com/luofeng225/services/trackbacks/279717.html
澶栬繛鎺?

宸﹀榪炴帴
鍙沖榪炴帴
瀹屽叏澶栬繛鎺?
鑷劧榪炴帴
  闃呰鍏ㄦ枃

]]>
CRUDhttp://www.tkk7.com/luofeng225/archive/2009/04/28/267975.htmlluofeng225luofeng225Tue, 28 Apr 2009 12:32:00 GMThttp://www.tkk7.com/luofeng225/archive/2009/04/28/267975.htmlhttp://www.tkk7.com/luofeng225/comments/267975.htmlhttp://www.tkk7.com/luofeng225/archive/2009/04/28/267975.html#Feedback0http://www.tkk7.com/luofeng225/comments/commentRss/267975.htmlhttp://www.tkk7.com/luofeng225/services/trackbacks/267975.html闃呰鍏ㄦ枃

]]>
group by,order by ,havinghttp://www.tkk7.com/luofeng225/archive/2009/03/28/262602.htmlluofeng225luofeng225Sat, 28 Mar 2009 06:26:00 GMThttp://www.tkk7.com/luofeng225/archive/2009/03/28/262602.htmlhttp://www.tkk7.com/luofeng225/comments/262602.htmlhttp://www.tkk7.com/luofeng225/archive/2009/03/28/262602.html#Feedback0http://www.tkk7.com/luofeng225/comments/commentRss/262602.htmlhttp://www.tkk7.com/luofeng225/services/trackbacks/262602.html闃呰鍏ㄦ枃

]]>
SQL閲嶅璁板綍鏌ヨhttp://www.tkk7.com/luofeng225/archive/2009/03/28/262583.htmlluofeng225luofeng225Sat, 28 Mar 2009 05:03:00 GMThttp://www.tkk7.com/luofeng225/archive/2009/03/28/262583.htmlhttp://www.tkk7.com/luofeng225/comments/262583.htmlhttp://www.tkk7.com/luofeng225/archive/2009/03/28/262583.html#Feedback0http://www.tkk7.com/luofeng225/comments/commentRss/262583.htmlhttp://www.tkk7.com/luofeng225/services/trackbacks/262583.htmlSQL閲嶅璁板綍鏌ヨ


1銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛岄噸澶嶈褰曟槸鏍規嵁鍗曚釜瀛楁錛坧eopleId錛夋潵鍒ゆ柇
select * from people
where peopleId in (select   peopleId from   people group by   peopleId having count (peopleId) > 1)

2銆佸垹闄よ〃涓浣欑殑閲嶅璁板綍錛岄噸澶嶈褰曟槸鏍規嵁鍗曚釜瀛楁錛坧eopleId錛夋潵鍒ゆ柇錛屽彧鐣欐湁rowid鏈灝忕殑璁板綍
delete from people
where peopleId in (select   peopleId from people group by   peopleId   having count (peopleId) > 1)
and rowid not in (select min(rowid) from   people group by peopleId having count(peopleId )>1)

3銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級
select * from vitae a
where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having

count(*) > 1)

4銆佸垹闄よ〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級錛屽彧鐣欐湁rowid鏈灝忕殑璁板綍
delete from vitae a
where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

5銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級錛屼笉鍖呭惈rowid鏈灝忕殑璁板綍
select * from vitae a
where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having

count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

(浜?
姣旀柟璇?br /> 鍦ˋ琛ㄤ腑瀛樺湪涓涓瓧孌?#8220;name”錛?br /> 鑰屼笖涓嶅悓璁板綍涔嬮棿鐨?#8220;name”鍊兼湁鍙兘浼氱浉鍚岋紝
鐜板湪灝辨槸闇瑕佹煡璇㈠嚭鍦ㄨ琛ㄤ腑鐨勫悇璁板綍涔嬮棿錛?#8220;name”鍊煎瓨鍦ㄩ噸澶嶇殑欏癸紱
Select Name,Count(*) From A Group By Name Having Count(*) > 1
濡傛灉榪樻煡鎬у埆涔熺浉鍚屽ぇ鍒欏涓?
Select Name,sex,Count(*) From A Group By Name,sex Having Count(*) > 1

(涓?
鏂規硶涓
declare @max integer,@id integer
declare cur_rows cursor local for select
涓誨瓧孌?count(*) from 琛ㄥ悕 group by 涓誨瓧孌?having

count(*) >錛?1
open cur_rows
fetch cur_rows into @id,@max
while @@fetch_status=0
begin
select @max = @max -1
set rowcount @max
delete from 琛ㄥ悕 where 涓誨瓧孌?= @id
fetch cur_rows into @id,@max
end
close cur_rows
set rowcount 0

鏂規硶浜?/p>

鏈変袱涓剰涔変笂鐨勯噸澶嶈褰曪紝涓鏄畬鍏ㄩ噸澶嶇殑璁板綍錛屼篃鍗蟲墍鏈夊瓧孌靛潎閲嶅鐨勮褰曪紝

浜屾槸閮ㄥ垎鍏抽敭瀛楁閲嶅鐨勮褰曪紝姣斿Name瀛楁閲嶅錛岃屽叾浠栧瓧孌典笉涓瀹氶噸澶嶆垨閮介噸澶嶅彲浠ュ拷鐣ャ?/p>

銆銆1銆佸浜庣涓縐嶉噸澶嶏紝姣旇緝瀹規槗瑙e喅錛屼嬌鐢?br /> select distinct * from tableName

銆銆灝卞彲浠ュ緱鍒版棤閲嶅璁板綍鐨勭粨鏋滈泦銆?/p>

銆銆濡傛灉璇ヨ〃闇瑕佸垹闄ら噸澶嶇殑璁板綍錛堥噸澶嶈褰曚繚鐣?鏉★級錛屽彲浠ユ寜浠ヤ笅鏂規硶鍒犻櫎
select distinct * into #Tmp from tableName
drop table tableName
select * into tableName from #Tmp
drop table #Tmp

銆銆鍙戠敓榪欑閲嶅鐨勫師鍥犳槸琛ㄨ璁′笉鍛ㄤ駭鐢熺殑錛屽鍔犲敮涓绱㈠紩鍒楀嵆鍙В鍐熾?/p>

銆銆2銆佽繖綾婚噸澶嶉棶棰橀氬父瑕佹眰淇濈暀閲嶅璁板綍涓殑絎竴鏉¤褰曪紝鎿嶄綔鏂規硶濡備笅

銆銆鍋囪鏈夐噸澶嶇殑瀛楁涓篘ame,Address錛岃姹傚緱鍒拌繖涓や釜瀛楁鍞竴鐨勭粨鏋滈泦
select identity(int,1,1) as autoID, * into #Tmp from tableName
select min(autoID) as autoID into #Tmp2 from #Tmp group by Name,autoID
select * from #Tmp where autoID in(select autoID from #tmp2)

銆銆鏈鍚庝竴涓猻elect鍗沖緱鍒頒簡Name錛孉ddress涓嶉噸澶嶇殑緇撴灉闆嗭紙浣嗗浜嗕竴涓猘utoID瀛楁錛屽疄闄呭啓鏃跺彲浠ュ啓

鍦╯elect瀛愬彞涓渷鍘繪鍒楋級

(鍥?鏌ヨ閲嶅
select * from tablename

where id in (select id from tablename group by id having count(id) > 1)

                                                            --from 緗戠粶

http://hi.baidu.com/zeronet/blog/item/27c41046d2c0060a6b63e596.html



]]>
主站蜘蛛池模板: 久久久久国产成人精品亚洲午夜 | 亚洲综合激情九月婷婷| 黄色视频在线免费观看| yy6080久久亚洲精品| 天堂亚洲免费视频| 亚洲视频在线免费| 二区久久国产乱子伦免费精品| AV在线亚洲男人的天堂| 在线看片免费人成视频久网下载| 亚洲自偷自偷偷色无码中文| 99精品免费视品| 久久久久亚洲AV无码网站| 亚洲成av人影院| 污视频在线免费观看| 亚洲丁香色婷婷综合欲色啪| 91精品免费在线观看| 亚洲乱色熟女一区二区三区蜜臀| 性做久久久久免费看| 久久免费观看视频| 亚洲综合精品香蕉久久网97| 毛片免费观看的视频在线| 欧美亚洲国产SUV| 亚洲女久久久噜噜噜熟女| 亚洲免费人成视频观看| 中文字幕亚洲情99在线| 亚洲国产婷婷综合在线精品 | 亚洲图片一区二区| 青青草免费在线视频| 美女黄频免费网站| 久久综合九九亚洲一区| 免费福利资源站在线视频| 亚洲精品自产拍在线观看| 91成人免费在线视频| 日本黄页网址在线看免费不卡| 亚洲高清在线播放| 国产裸模视频免费区无码| 国产午夜无码精品免费看| 亚洲色中文字幕在线播放| 亚洲精品美女久久777777| 毛片免费视频观看| 精品国产一区二区三区免费|