锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲激情精品,成人午夜国产,国产成人亚洲综合http://www.aygfsteel.com/luofeng225/category/38589.html鐢熶簬蹇ф?zhèn)eQ屾浜庡畨涔愩?/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銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛岄噸澶嶈褰曟槸鏍規(guī)嵁鍗曚釜瀛楁錛坧eopleId錛夋潵鍒ゆ柇
select * from people
where peopleId in (select   peopleId from   people group by   peopleId having count (peopleId) > 1)

2銆佸垹闄よ〃涓浣欑殑閲嶅璁板綍錛岄噸澶嶈褰曟槸鏍規(guī)嵁鍗曚釜瀛楁錛坧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銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級(jí)
select * from vitae a
where (a.peopleId,a.seq) in   (select peopleId,seq from vitae group by peopleId,seq having

count(*) > 1)

4銆佸垹闄よ〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級(jí)錛屽彧鐣欐湁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銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級(jí)錛屼笉鍖呭惈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”鍊兼湁鍙兘浼?xì)鐩稿悓锛?br /> 鐜板湪灝辨槸闇瑕佹煡璇㈠嚭鍦ㄨ琛ㄤ腑鐨勫悇璁板綍涔嬮棿錛?#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

(涓?
鏂規(guī)硶涓
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

鏂規(guī)硶浜?/p>

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

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

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

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

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

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

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

銆銆鍋囪鏈夐噸澶嶇殑瀛楁涓篘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鍗沖緱鍒頒簡(jiǎn)Name錛孉ddress涓嶉噸澶嶇殑緇撴灉闆嗭紙浣嗗浜?jiǎn)涓涓猘utoID瀛楁錛屽疄闄呭啓鏃跺彲浠ュ啓

鍦╯elect瀛愬彞涓渷鍘繪鍒楋級(jí)

(鍥?鏌ヨ閲嶅
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



]]>
主站蜘蛛池模板: 阆中市| 台江县| 育儿| 乌拉特后旗| 北碚区| 广南县| 磐安县| 车致| 丁青县| 凌海市| 邻水| 新晃| 淮安市| 三亚市| 丹巴县| 东安县| 屏东市| 凤山县| 时尚| 卫辉市| 晋城| 中卫市| 太和县| 吉木萨尔县| 安阳市| 兴山县| 虎林市| 吉安县| 永康市| 旬邑县| 佛冈县| 胶州市| 江北区| 连城县| 古田县| 朝阳市| 永宁县| 通海县| 玉林市| 姜堰市| 河源市|