锘??xml version="1.0" encoding="utf-8" standalone="yes"?>免费看欧美美女黄的网站,国产精品一区在线播放,精品精品国产三级a∨在线http://www.aygfsteel.com/luofeng225/category/38589.html鐢熶簬蹇ф偅錛屾浜庡畨涔愩?/description>zh-cnSat, 06 Jun 2009 01:42:33 GMTSat, 06 Jun 2009 01:42:33 GMT60鍐呰繛鎺ワ紝澶栬繛鎺ワ紝鑷劧榪炴帴http://www.aygfsteel.com/luofeng225/archive/2009/06/02/279717.htmlluofeng225luofeng225Tue, 02 Jun 2009 15:24:00 GMThttp://www.aygfsteel.com/luofeng225/archive/2009/06/02/279717.htmlhttp://www.aygfsteel.com/luofeng225/comments/279717.htmlhttp://www.aygfsteel.com/luofeng225/archive/2009/06/02/279717.html#Feedback0http://www.aygfsteel.com/luofeng225/comments/commentRss/279717.htmlhttp://www.aygfsteel.com/luofeng225/services/trackbacks/279717.html
澶栬繛鎺?

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

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

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

]]>
SQL閲嶅璁板綍鏌ヨhttp://www.aygfsteel.com/luofeng225/archive/2009/03/28/262583.htmlluofeng225luofeng225Sat, 28 Mar 2009 05:03:00 GMThttp://www.aygfsteel.com/luofeng225/archive/2009/03/28/262583.htmlhttp://www.aygfsteel.com/luofeng225/comments/262583.htmlhttp://www.aygfsteel.com/luofeng225/archive/2009/03/28/262583.html#Feedback0http://www.aygfsteel.com/luofeng225/comments/commentRss/262583.htmlhttp://www.aygfsteel.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



]]>
主站蜘蛛池模板: 南康市| 屏山县| 山东省| 新乡县| 宁化县| 仪征市| 富蕴县| 绍兴县| 长宁区| 镇赉县| 大同县| 新源县| 荃湾区| 云阳县| 天柱县| 宿州市| 景洪市| 浦城县| 错那县| 安阳市| 玛纳斯县| 丹凤县| 永春县| 武冈市| 富蕴县| 蒙城县| 绥阳县| 肃北| 会同县| 中江县| 乌兰县| 屯门区| 容城县| 和政县| 车致| 泾川县| 甘泉县| 喀什市| 桃源县| 宿松县| 民乐县|