锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品夜夜夜妓女网,亚洲综合男人的天堂色婷婷,久久久久亚洲AV无码网站http://www.tkk7.com/Werther/category/37767.htmlLive as if you were to die tomorrow. Learn as if you were to live forever. zh-cnThu, 22 Oct 2009 13:53:41 GMTThu, 22 Oct 2009 13:53:41 GMT60SQL Server鏁版嵁搴撳紑鍙戠殑浜屽崄涓鏉″啗瑙?/title><link>http://www.tkk7.com/Werther/archive/2009/10/22/299331.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Thu, 22 Oct 2009 04:53:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/10/22/299331.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/299331.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/10/22/299331.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/299331.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/299331.html</trackback:ping><description><![CDATA[     鎽樿: 濡傛灉浣犳鍦ㄨ礋璐d竴涓熀浜嶴QL Server鐨勯」鐩紝鎴栬呬綘鍒氬垰鎺ヨЕSQL Server錛屼綘閮芥湁鍙兘瑕侀潰涓翠竴浜涙暟鎹簱鎬ц兘鐨勯棶棰橈紝榪欑瘒鏂囩珷浼氫負浣犳彁渚涗竴浜涙湁鐢ㄧ殑鎸囧錛堝叾涓ぇ澶氭暟涔熷彲浠ョ敤浜庡叾瀹冪殑DBMS錛夈? <br>鍦ㄨ繖閲岋紝鎴戜笉鎵撶畻浠嬬粛浣跨敤SQL Server鐨勭獚闂紝涔熶笉鑳芥彁渚涗竴涓寘娌葷櫨鐥呯殑鏂規錛屾垜鎵鍋氱殑鏄葷粨涓浜涚粡楠?---鍏充簬濡備綍褰㈡垚涓涓ソ鐨勮璁°傝繖浜涚粡楠屾潵鑷垜榪囧幓鍑犲勾涓粡鍙楃殑鏁欒錛屼竴鐩存潵錛屾垜鐪嬪埌璁稿鍚屾牱鐨勮璁¢敊璇涓嬈″張涓嬈$殑閲嶅銆? <br>  <a href='http://www.tkk7.com/Werther/archive/2009/10/22/299331.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Werther/aggbug/299331.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-10-22 12:53 <a href="http://www.tkk7.com/Werther/archive/2009/10/22/299331.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>SQL Server2000涓瓧絎︿覆鍚堝茍鐨勯棶棰?/title><link>http://www.tkk7.com/Werther/archive/2009/05/21/271959.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Thu, 21 May 2009 05:59:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/05/21/271959.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/271959.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/05/21/271959.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/271959.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/271959.html</trackback:ping><description><![CDATA[     鎽樿: 瑙e喅SQL Server2000涓瓧絎︿覆鍚堝茍鐨勪緥棰?nbsp; <a href='http://www.tkk7.com/Werther/archive/2009/05/21/271959.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Werther/aggbug/271959.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-05-21 13:59 <a href="http://www.tkk7.com/Werther/archive/2009/05/21/271959.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>濡備綍灝嗕俊鎭姹傜炕璇戜負SQL SELECT璇彞錛堜竴錛?/title><link>http://www.tkk7.com/Werther/archive/2009/05/06/269143.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Wed, 06 May 2009 00:20:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/05/06/269143.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/269143.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/05/06/269143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/269143.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/269143.html</trackback:ping><description><![CDATA[     鎽樿: 鏈枃璇︾粏浠嬬粛浜嗗皢淇℃伅璇鋒眰緲昏瘧涓篠QL SELECT璇彞榪欎竴鎶宸т腑鐨勫皢璇鋒眰緲昏瘧涓篠QL鐨勬柟娉? <br>鍏抽敭璇嶏細SQL Server 灝嗚姹傜炕璇戜負SQL SQL SELECT <br>  <a href='http://www.tkk7.com/Werther/archive/2009/05/06/269143.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Werther/aggbug/269143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-05-06 08:20 <a href="http://www.tkk7.com/Werther/archive/2009/05/06/269143.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>SQL鍙栧嚭 鎵鏈夊懆鍏?鍛ㄦ棩鐨勬棩鏈?http://www.tkk7.com/Werther/archive/2009/05/05/268922.htmlWertherWertherTue, 05 May 2009 02:04:00 GMThttp://www.tkk7.com/Werther/archive/2009/05/05/268922.htmlhttp://www.tkk7.com/Werther/comments/268922.htmlhttp://www.tkk7.com/Werther/archive/2009/05/05/268922.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/268922.htmlhttp://www.tkk7.com/Werther/services/trackbacks/268922.html闃呰鍏ㄦ枃

Werther 2009-05-05 10:04 鍙戣〃璇勮
]]>
鍏ㄥ嫟鐛庣殑璦堢畻http://www.tkk7.com/Werther/archive/2009/04/09/264690.htmlWertherWertherThu, 09 Apr 2009 11:32:00 GMThttp://www.tkk7.com/Werther/archive/2009/04/09/264690.htmlhttp://www.tkk7.com/Werther/comments/264690.htmlhttp://www.tkk7.com/Werther/archive/2009/04/09/264690.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/264690.htmlhttp://www.tkk7.com/Werther/services/trackbacks/264690.html闃呰鍏ㄦ枃

Werther 2009-04-09 19:32 鍙戣〃璇勮
]]>
SQL Server瑙嗛銆佺數瀛愪功鍏嶈垂涓嬭澆涓撹緫http://www.tkk7.com/Werther/archive/2009/04/07/264179.htmlWertherWertherTue, 07 Apr 2009 00:15:00 GMThttp://www.tkk7.com/Werther/archive/2009/04/07/264179.htmlhttp://www.tkk7.com/Werther/comments/264179.htmlhttp://www.tkk7.com/Werther/archive/2009/04/07/264179.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/264179.htmlhttp://www.tkk7.com/Werther/services/trackbacks/264179.html闃呰鍏ㄦ枃

Werther 2009-04-07 08:15 鍙戣〃璇勮
]]>
SQL娉ㄥ叆涓撻http://www.tkk7.com/Werther/archive/2009/04/02/263521.htmlWertherWertherThu, 02 Apr 2009 04:34:00 GMThttp://www.tkk7.com/Werther/archive/2009/04/02/263521.htmlhttp://www.tkk7.com/Werther/comments/263521.htmlhttp://www.tkk7.com/Werther/archive/2009/04/02/263521.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/263521.htmlhttp://www.tkk7.com/Werther/services/trackbacks/263521.html闃呰鍏ㄦ枃

Werther 2009-04-02 12:34 鍙戣〃璇勮
]]>
瀹炵幇涓や釜鏁版嵁搴撶殑鍚屾http://www.tkk7.com/Werther/archive/2009/04/02/263519.htmlWertherWertherThu, 02 Apr 2009 04:30:00 GMThttp://www.tkk7.com/Werther/archive/2009/04/02/263519.htmlhttp://www.tkk7.com/Werther/comments/263519.htmlhttp://www.tkk7.com/Werther/archive/2009/04/02/263519.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/263519.htmlhttp://www.tkk7.com/Werther/services/trackbacks/263519.html闃呰鍏ㄦ枃

Werther 2009-04-02 12:30 鍙戣〃璇勮
]]>
錛籌急錛?璇硶鍙傝冩墜鍐?http://www.tkk7.com/Werther/archive/2009/03/27/262274.htmlWertherWertherFri, 27 Mar 2009 00:04:00 GMThttp://www.tkk7.com/Werther/archive/2009/03/27/262274.htmlhttp://www.tkk7.com/Werther/comments/262274.htmlhttp://www.tkk7.com/Werther/archive/2009/03/27/262274.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/262274.htmlhttp://www.tkk7.com/Werther/services/trackbacks/262274.html闃呰鍏ㄦ枃

Werther 2009-03-27 08:04 鍙戣〃璇勮
]]>
宸茬煡騫存湀姹傛騫存湀鐨勭涓澶╁拰鏈寰屼竴澶?/title><link>http://www.tkk7.com/Werther/archive/2009/03/25/261861.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Wed, 25 Mar 2009 06:48:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/03/25/261861.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/261861.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/03/25/261861.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/261861.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/261861.html</trackback:ping><description><![CDATA[     鎽樿: 宸茬煡騫存湀姹傛騫存湀鐨勭涓澶╁拰鏈寰屼竴澶?nbsp; <a href='http://www.tkk7.com/Werther/archive/2009/03/25/261861.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Werther/aggbug/261861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-03-25 14:48 <a href="http://www.tkk7.com/Werther/archive/2009/03/25/261861.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>SQL鍛戒護澶у叏-涓嫳鏂囧鐓?/title><link>http://www.tkk7.com/Werther/archive/2009/03/24/261618.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Tue, 24 Mar 2009 00:15:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/03/24/261618.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/261618.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/03/24/261618.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/261618.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/261618.html</trackback:ping><description><![CDATA[     鎽樿: SQL鍛戒護澶у叏-涓嫳鏂囧鐓?nbsp; <a href='http://www.tkk7.com/Werther/archive/2009/03/24/261618.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Werther/aggbug/261618.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-03-24 08:15 <a href="http://www.tkk7.com/Werther/archive/2009/03/24/261618.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>sql server涓垎甯冨紡鏌ヨhttp://www.tkk7.com/Werther/archive/2009/03/23/261536.htmlWertherWertherMon, 23 Mar 2009 07:43:00 GMThttp://www.tkk7.com/Werther/archive/2009/03/23/261536.htmlhttp://www.tkk7.com/Werther/comments/261536.htmlhttp://www.tkk7.com/Werther/archive/2009/03/23/261536.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/261536.htmlhttp://www.tkk7.com/Werther/services/trackbacks/261536.html緇忓父寰楀湪sql server涓煡璇笉鍚屾暟鎹簱涓暟鎹?
榪欏氨浜х敓浜嗗垎甯冨紡鏌ヨ鐨勯渶姹?  闃呰鍏ㄦ枃

Werther 2009-03-23 15:43 鍙戣〃璇勮
]]>
SQL Server鏃ユ湡鏍煎紡鐨勮漿鎹?/title><link>http://www.tkk7.com/Werther/archive/2009/03/20/260994.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Fri, 20 Mar 2009 03:20:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/03/20/260994.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/260994.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/03/20/260994.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/260994.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/260994.html</trackback:ping><description><![CDATA[     鎽樿: SQL Server涓枃鐗堢殑榛樿鐨勬棩鏈熷瓧孌礵atetime鏍煎紡鏄痽yyy-mm-dd Thh:mm:ss.mmm   <a href='http://www.tkk7.com/Werther/archive/2009/03/20/260994.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/Werther/aggbug/260994.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-03-20 11:20 <a href="http://www.tkk7.com/Werther/archive/2009/03/20/260994.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>灝囨暩鎿氬韓閲岀殑璩囨枡鎷嗗垎鏌ュ嚭http://www.tkk7.com/Werther/archive/2009/03/11/258991.htmlWertherWertherWed, 11 Mar 2009 00:44:00 GMThttp://www.tkk7.com/Werther/archive/2009/03/11/258991.htmlhttp://www.tkk7.com/Werther/comments/258991.htmlhttp://www.tkk7.com/Werther/archive/2009/03/11/258991.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/258991.htmlhttp://www.tkk7.com/Werther/services/trackbacks/258991.html鍒嗘媶鍒楀?

鍘熻憲錛氶偣寤?
鏀圭紪錛氱埍鏂拌緗?姣撳崕(鍗佸叓騫撮闆?瀹堝緱鍐板北闆幉鑺卞紑)  2007-12-16  騫夸笢娣卞湷

鏈夎〃tb, 濡備笅:
id          value
----------- -----------
1          aa,bb
2          aaa,bbb,ccc
嬈叉寜id,鍒嗘媶value鍒? 鍒嗘媶鍚庣粨鏋滃涓?
id          value
----------- --------
1          aa
1          bb
2          aaa
2          bbb
2          ccc

1. 鏃х殑瑙e喅鏂規硶(sql server 2000)
SELECT TOP 8000 id = IDENTITY(int, 1, 1) INTO # FROM syscolumns a, syscolumns b

SELECT A.id, SUBSTRING(A.[values], B.id, CHARINDEX(',', A.[values] + ',', B.id) - B.id)
FROM tb A, # B
WHERE SUBSTRING(',' + A.[values], B.id, 1) = ','

DROP TABLE #

2. 鏂扮殑瑙e喅鏂規硶(sql server 2005)

create table tb(id int,value varchar(30))
insert into tb values(1,'aa,bb')
insert into tb values(2,'aaa,bbb,ccc')
go
SELECT A.id, B.value
FROM(
   
SELECT id, [value] = CONVERT(xml,' <root> <v>' + REPLACE([value], ',', ' </v> <v>') + ' </v> </root>') FROM tb
)A
OUTER APPLY(
   
SELECT value = N.v.value('.', 'varchar(100)') FROM A.[value].nodes('/root/v') N(v)
)B

DROP TABLE tb

/*
id          value
----------- ------------------------------
1          aa
1          bb
2          aaa
2          bbb
2          ccc

(5 琛屽彈褰卞搷)
*/


Werther 2009-03-11 08:44 鍙戣〃璇勮
]]>
灝嘐xcel鐨勬暩鎿氭彃鍏ュ埌鏁告摎搴腑紺轟緥http://www.tkk7.com/Werther/archive/2009/03/10/258859.htmlWertherWertherTue, 10 Mar 2009 09:11:00 GMThttp://www.tkk7.com/Werther/archive/2009/03/10/258859.htmlhttp://www.tkk7.com/Werther/comments/258859.htmlhttp://www.tkk7.com/Werther/archive/2009/03/10/258859.html#Feedback3http://www.tkk7.com/Werther/comments/commentRss/258859.htmlhttp://www.tkk7.com/Werther/services/trackbacks/258859.html闃呰鍏ㄦ枃

Werther 2009-03-10 17:11 鍙戣〃璇勮
]]>
灝咵xcel鐨勬暟鎹鍏QL server http://www.tkk7.com/Werther/archive/2009/02/24/256443.htmlWertherWertherTue, 24 Feb 2009 07:59:00 GMThttp://www.tkk7.com/Werther/archive/2009/02/24/256443.htmlhttp://www.tkk7.com/Werther/comments/256443.htmlhttp://www.tkk7.com/Werther/archive/2009/02/24/256443.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/256443.htmlhttp://www.tkk7.com/Werther/services/trackbacks/256443.html--鍙互閫氳繃浣跨敤 OPENDATASOURCE 鎴?OPENROWSET 鍑芥暟涓虹壒瀹氱洰鐨勫鍏ユ暟鎹?br /> --涓嬪垪浠g爜紺轟緥涔熻兘灝?Excel Customers 宸ヤ綔琛ㄦ暟鎹鍏ユ柊鐨?SQL Server 琛細
鏂規硶涓錛?br />
SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=E:\Temp.xls;Extended Properties=Excel 5.0')...[Temp$]
鏂規硶浜岋細

SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;Database=E:\Temp.xls', [Temp$])

鏂規硶涓夛細

SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;Database=E:\Temp.xls', 'SELECT * FROM [Temp$]')
--鍍忛欏嬭〃瑁¢潰綣肩簩娣誨姞璦橀寗
INSERT INTO XLImport5
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;Database=E:\Temp.xls', 'SELECT * FROM [Temp$]')


SELECT * FROM XLImport5

DROP TABLE XLImport3
DROP TABLE XLImport4
DROP TABLE XLImport5

[Temp$]鎸囩殑鏅傚欎綘鐨凟xcel琛ㄦ牸瑁¢潰鐨凷heet鍚嶇ū錛岃寰楃編鍏冪鍚堟槸寰岄潰鍔犱笂鍘葷殑錛屾槸蹇呴爤瑕佸姞鐨勶紝濡傛灉浣犵殑Excel鏄?.0鐨勶紝鍙渶瑕丒xcel 5.0鍗沖彲銆?br />



Werther 2009-02-24 15:59 鍙戣〃璇勮
]]>
蹇熸瘮杈冪粨鏋勭浉鍚岀殑涓よ〃http://www.tkk7.com/Werther/archive/2009/02/24/256421.htmlWertherWertherTue, 24 Feb 2009 06:11:00 GMThttp://www.tkk7.com/Werther/archive/2009/02/24/256421.htmlhttp://www.tkk7.com/Werther/comments/256421.htmlhttp://www.tkk7.com/Werther/archive/2009/02/24/256421.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/256421.htmlhttp://www.tkk7.com/Werther/services/trackbacks/256421.html     /* 緇撴瀯鐩稿悓鐨勪袱琛紝涓琛ㄦ湁璁板綍3涓囨潯宸﹀彸錛屼竴琛ㄦ湁璁板綍2涓囨潯宸﹀彸錛屾垜鎬庢牱蹇熸煡鎵句袱琛ㄧ殑涓嶅悓璁板綍錛?/

      -- 緇欎綘涓涓祴璇曟柟娉曪紝浠巒orthwind涓殑orders琛ㄥ彇鏁版嵁銆?br />        select * into n1 from orders
       select * into n2 from orders
 
       select * from n1
       select * from n2
 
       --娣誨姞涓婚敭錛岀劧鍚庝慨鏀筺1涓嫢騫插瓧孌電殑鑻ュ共鏉?br />        alter table n1 add constraint pk_n1_id primary key (OrderID)
       alter table n2 add constraint pk_n2_id primary key (OrderID)
 
       select OrderID from (select * from n1 union select * from n2) a group by OrderID having count(*) > 1
 
      /* 搴旇鍙互錛岃屼笖灝嗕笉鍚岀殑璁板綍鐨処D鏄劇ず鍑烘潵銆備笅闈㈢殑閫傜敤浜庡弻鏂硅褰曚竴鏍風殑鎯呭喌錛?/
 
       select * from n1 where orderid in (select OrderID from (select * from n1 union select * from n2) a group by OrderID having count(*) > 1)
 -- 鑷充簬鍙屾柟浜掍笉瀛樺湪鐨勮褰曟槸姣旇緝濂藉鐞嗙殑
 --鍒犻櫎n1,n2涓嫢騫叉潯璁板綍
       delete from n1 where orderID in ('10728','10730')
       delete from n2 where orderID in ('11000','11001')
 
       --*************************************************************
       -- 鍙屾柟閮芥湁璇ヨ褰曞嵈涓嶅畬鍏ㄧ浉鍚?br />        select * from n1 where orderid in(select OrderID from (select * from n1 union select * from n2) a group by OrderID having count(*) > 1)
       union
       --n2涓瓨鍦ㄤ絾鍦╪1涓笉瀛樼殑鍦?0728,10730
       select * from n1 where OrderID not in (select OrderID from n2)
       union
       --n1涓瓨鍦ㄤ絾鍦╪2涓笉瀛樼殑鍦?1000,11001
       select * from n2 where OrderID not in (select OrderID from n1)



Werther 2009-02-24 14:11 鍙戣〃璇勮
]]>
綞撳吀SQL琛屽垪杞崲http://www.tkk7.com/Werther/archive/2009/02/20/255828.htmlWertherWertherFri, 20 Feb 2009 07:05:00 GMThttp://www.tkk7.com/Werther/archive/2009/02/20/255828.htmlhttp://www.tkk7.com/Werther/comments/255828.htmlhttp://www.tkk7.com/Werther/archive/2009/02/20/255828.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/255828.htmlhttp://www.tkk7.com/Werther/services/trackbacks/255828.html鍟忛錛?鍋囪鏈夊紶瀛︾敓鎴愮嘩琛?Test)濡備笅
       Name Subject Result
       寮犱笁 璇枃 80
       寮犱笁 鏁板 90
       寮犱笁 鐗╃悊 85
       鏉庡洓 璇枃 85
       鏉庡洓 鏁板 92
       鏉庡洓 鐗╃悊 82
 
緄愭灉錛?br />        濮撳悕 璇枃 鏁板 鐗╃悊
       寮犱笁 80 90 85
       鏉庡洓 85 92 82

DROP TABLE Test
create table Test(Name varchar(10),Subject Varchar(10),Result int)
insert Test
select '寮典笁','瑾炴枃',80 union all
select '寮典笁','鏁稿',90 union all
select '寮典笁','鐗╃悊',85 union all
select '鏉庡洓','瑾炴枃',85 union all
select '鏉庡洓','鏁稿',92 union all
select '鏉庡洓','鐗╃悊',82
go

SELECT * FROM Test
 
--鐢ㄦ柤澶氳鐨勮綁鎻?br /> declare @sql varchar(4000)
set @sql = 'select Name'
select @sql = @sql + ',sum(case Subject when '''+Subject+''' then Result end) ['+Subject+']'
from (select distinct Subject from test) as a
select @sql = @sql+' from test group by name'
       exec(@sql)

--濡傛灉琛屾暩灝戦欏嬬湅璧蜂締鏇村姞鏄庣灜
select Name as 濮撳悕,
 sum(case Subject when '鏁稿' then Result end) [鏁稿],
 sum(case Subject when '鐗╃悊' then Result end) [鐗╃悊],
 sum(case Subject when '瑾炴枃' then Result end) [瑾炴枃]
from Test group by name

鎴戜互鍓嶉潰瑭︾殑鏅傚欒冭│閬庨欑ó欏炰技鐨勯錛屼篃鏄垜鍊戝湪綬ㄧ▼闁嬬櫦閬庣▼涓稉甯擱亣鍒扮殑涓紼父瑕嬮錛屾垜鐨勫垎鏋愬笇鏈涘皪澶у鏈夊公鍔┿?/p>


 



Werther 2009-02-20 15:05 鍙戣〃璇勮
]]>
SQL Server鏃ユ湡璁$畻http://www.tkk7.com/Werther/archive/2009/02/20/255827.htmlWertherWertherFri, 20 Feb 2009 06:38:00 GMThttp://www.tkk7.com/Werther/archive/2009/02/20/255827.htmlhttp://www.tkk7.com/Werther/comments/255827.htmlhttp://www.tkk7.com/Werther/archive/2009/02/20/255827.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/255827.htmlhttp://www.tkk7.com/Werther/services/trackbacks/255827.html        SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)

 b. 鏈懆鐨勬槦鏈熶竴
       SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)

c. 涓騫寸殑絎竴澶?br />        SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)

d. 瀛e害鐨勭涓澶?br />        SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)

e. 涓婁釜鏈堢殑鏈鍚庝竴澶?br />        SELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0))

f. 鍘誨勾鐨勬渶鍚庝竴澶?br />        SELECT dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate()), 0))

g. 鏈湀鐨勬渶鍚庝竴澶?br />        SELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate())+1, 0))

h. 鏈湀鐨勭涓涓槦鏈熶竴
       select DATEADD(wk, DATEDIFF(wk,0, dateadd(dd,6-datepart(day,getdate()),getdate()) ), 0)

i. 鏈勾鐨勬渶鍚庝竴澶?br />        SELECT dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate())+1, 0))

Werther 2009-02-20 14:38 鍙戣〃璇勮
]]>
SQL鏌ヨ鍒嗘瀽鍣ㄤ唬鐮佺殑褰㈠紡灝庡嚭璧勬枡錛?/title><link>http://www.tkk7.com/Werther/archive/2009/02/19/255596.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Thu, 19 Feb 2009 09:15:00 GMT</pubDate><guid>http://www.tkk7.com/Werther/archive/2009/02/19/255596.html</guid><wfw:comment>http://www.tkk7.com/Werther/comments/255596.html</wfw:comment><comments>http://www.tkk7.com/Werther/archive/2009/02/19/255596.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/Werther/comments/commentRss/255596.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/Werther/services/trackbacks/255596.html</trackback:ping><description><![CDATA[<p style="font-size: 12pt">  <span style="font-family: Tahoma">SQL</span><span style="font-family: 鏂扮窗鏄庨珨">浠g爜</span><span style="font-family: Tahoma">:   <br /> <br />   EXEC   master..xp_cmdshell   'bcp   </span><span style="font-family: 鏂扮窗鏄庨珨">搴撳悕</span><span style="font-family: Tahoma">.dbo.</span><span style="font-family: 鏂扮窗鏄庨珨">琛ㄥ悕</span><span style="font-family: Tahoma">out   c:\Temp.xls   -c   -q   -S"servername"   -U"sa"   -P""'   <br />  </span><span style="font-family: 鏂扮窗鏄庨珨">鍙傛暟錛?/span><span style="font-family: Tahoma">S   </span><span style="font-family: 鏂扮窗鏄庨珨">鏄?/span><span style="font-family: Tahoma">SQL</span><span style="font-family: 鏂扮窗鏄庨珨">鏈嶅姟鍣ㄥ悕錛?/span><span style="font-family: Tahoma">U</span><span style="font-family: 鏂扮窗鏄庨珨">鏄敤鎴鳳紱</span><span style="font-family: Tahoma">P</span><span style="font-family: 鏂扮窗鏄庨珨">鏄瘑鐮?/span> <span style="font-family: Tahoma"><br />  </span><span style="font-family: 鏂扮窗鏄庨珨">璇存槑錛氳繕鍙互瀵煎嚭鏂囨湰鏂囦歡絳夊縐嶆牸寮?/span><span style="font-family: Tahoma">   <br />  </span><span style="font-family: 鏂扮窗鏄庨珨">瀹炰緥</span><span style="font-family: Tahoma">1:<br /> EXEC   master..xp_cmdshell   'bcp   pubs.dbo.employee   out   c:\temp1.xls   -c   -q   -S"172.16.1.101"   -U"sa"   -P"sa"'   <br />  </span><span style="font-family: 鏂扮窗鏄庨珨">瀹炰緥</span><span style="font-family: Tahoma">2:<br /> EXEC   master..xp_cmdshell   'bcp   "SELECT   au_fname,   au_lname   FROM   pubs..authors   ORDER   BY   au_lname"   queryout   c:\Temp.xls   -c -S"172.16.1.101"   -U"sa"   -P"sa"' <br /> <br /> </span><span style="font-family: 鏂扮窗鏄庨珨">榪欎釜鏇村鏄撹澶у鐞嗚В錛屾敞鎰?/span><span style="font-family: Tahoma">servername</span><span style="font-family: 鏂扮窗鏄庨珨">搴旇鍐欎綘</span><span style="font-family: Tahoma">computer</span><span style="font-family: 鏂扮窗鏄庨珨">鐨?/span><span style="font-family: Tahoma">IP</span><span style="font-family: 鏂扮窗鏄庨珨">鍦板潃錛屽疄渚?/span><span style="font-family: Tahoma">1</span><span style="font-family: 鏂扮窗鏄庨珨">銆?/span><span style="font-family: Tahoma">2</span><span style="font-family: 鏂扮窗鏄庨珨">鍙浣犳敼涓涓?/span><span style="font-family: Tahoma">IP</span><span style="font-family: 鏂扮窗鏄庨珨">灝卞彲浠ョ湅寰楀埌緇撴灉鐨勪竴涓疄渚?閭勬湁涓榛為渶瑕佸ぇ瀹舵敞鎰忥紝鍦ㄥ煼琛孲QL瑾炲彞鐨勬檪鍊欙紝鍠紩铏熻!闈㈢殑瀛楃涓叉槸涓嶈兘鎻涜鍩瘋鐨勶紝濡傛灉鎻涜灝囨渻鍫遍尟銆?/span></p> <p style="font-size: 12pt"><strong></strong> </p> <img src ="http://www.tkk7.com/Werther/aggbug/255596.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/Werther/" target="_blank">Werther</a> 2009-02-19 17:15 <a href="http://www.tkk7.com/Werther/archive/2009/02/19/255596.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>綺懼鐨凷QL鍜孲QL SERVER 涓嶢CCESS銆丒XCEL鐨勬暟鎹鍏ュ鍑鴻漿鎹?http://www.tkk7.com/Werther/archive/2009/02/18/255254.htmlWertherWertherWed, 18 Feb 2009 05:57:00 GMThttp://www.tkk7.com/Werther/archive/2009/02/18/255254.htmlhttp://www.tkk7.com/Werther/comments/255254.htmlhttp://www.tkk7.com/Werther/archive/2009/02/18/255254.html#Feedback0http://www.tkk7.com/Werther/comments/commentRss/255254.htmlhttp://www.tkk7.com/Werther/services/trackbacks/255254.html闃呰鍏ㄦ枃

Werther 2009-02-18 13:57 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 美女视频黄免费亚洲| 亚洲不卡中文字幕无码| 亚洲国产成人综合精品| 免费看韩国黄a片在线观看| 国产v亚洲v天堂a无| 97无码免费人妻超级碰碰碰碰| 亚洲国产成人久久综合一区| 久草在视频免费福利| 中文字幕无码精品亚洲资源网久久| 国产免费久久精品99re丫y| 亚洲H在线播放在线观看H| 成人无遮挡裸免费视频在线观看 | 免费毛片a线观看| 亚洲国产日韩一区高清在线 | 国产又大又粗又硬又长免费| 男男gay做爽爽的视频免费| 精品亚洲一区二区三区在线播放| 香蕉视频在线免费看| 久久久久久亚洲精品成人| 麻豆国产精品免费视频| 亚洲老熟女五十路老熟女bbw | 国产日韩AV免费无码一区二区| 色婷婷亚洲十月十月色天| 在线观看日本免费a∨视频| 亚洲a∨无码一区二区| 久久久久亚洲AV综合波多野结衣 | 亚洲中文无码线在线观看| 国产精品冒白浆免费视频| 精品人妻系列无码人妻免费视频| 亚洲av色影在线| 扒开双腿猛进入爽爽免费视频| 国产天堂亚洲精品| 亚洲精品私拍国产福利在线| 女人18毛片水最多免费观看 | 一级看片免费视频| 亚洲综合综合在线| 亚洲高清无码在线观看| 每天更新的免费av片在线观看| 最新亚洲人成无码网www电影| 久久亚洲综合色一区二区三区| 亚洲中文无码永久免费|