榪斿洖緇撴灉闆嗗垎鍖哄唴琛岀殑搴忓垪鍙鳳紝姣忎釜鍒嗗尯鐨勭涓琛屼粠 1 寮濮嬨?/p>
璇硶
聽(tīng)
ROW_NUMBER ( )聽(tīng)聽(tīng)聽(tīng)聽(tīng) OVER ( [ <partition_by_clause> ] <order_by_clause> )
聽(tīng)
澶囨敞
ORDER BY 瀛愬彞鍙‘瀹氬湪鐗瑰畾鍒嗗尯涓負(fù)琛屽垎閰嶅敮涓 ROW_NUMBER 鐨勯『搴忋?/p>
鍙傛暟
<partition_by_clause>
灝?FROM 瀛愬彞鐢熸垚鐨勭粨鏋滈泦鍒掑叆搴旂敤浜?ROW_NUMBER 鍑芥暟鐨勫垎鍖恒?
<order_by_clause>
紜畾灝?ROW_NUMBER 鍊煎垎閰嶇粰鍒嗗尯涓殑琛岀殑欏哄簭銆傛湁鍏寵緇嗕俊鎭紝璇峰弬闃?ORDER BY 瀛愬彞 (Transact-SQL)銆?/p>
鏈夊叧璇︾粏淇℃伅錛岃鍙傞槄 OVER 瀛愬彞 (Transact-SQL)銆?/p>
榪斿洖綾誨瀷
bigint
紺轟緥
浠ヤ笅紺轟緥灝嗘牴鎹勾鍒濊嚦浠婄殑閿鍞錛岃繑鍥?AdventureWorks 涓攢鍞漢鍛樼殑 ROW_NUMBER銆?/p>
聽(tīng)澶嶅埗浠g爜
USE AdventureWorks
GO
SELECT c.FirstName, c.LastName, ROW_NUMBER() OVER(ORDER BY SalesYTD DESC) AS 'Row Number', s.SalesYTD, a.PostalCode
FROM Sales.SalesPerson s JOIN Person.Contact c on s.SalesPersonID = c.ContactID
JOIN Person.Address a ON a.AddressID = c.ContactID
WHERE TerritoryID IS NOT NULL AND SalesYTD <> 0
聽(tīng)
浠ヤ笅紺轟緥灝嗚繑鍥炶鍙蜂負(fù) 50 鍒?60錛堝惈錛夌殑琛岋紝騫朵互 OrderDate 鎺掑簭銆?/p>
聽(tīng)澶嶅埗浠g爜
USE AdventureWorks;
GO
WITH OrderedOrders AS
(SELECT SalesOrderID, OrderDate,
ROW_NUMBER() OVER (order by OrderDate)as RowNumber
FROM Sales.SalesOrderHeader )
SELECT *
FROM OrderedOrders
WHERE RowNumber between 50 and 60;聽(tīng)
==============================
榪涜繃鎴戝鐧句竾琛屾暟鎹褰曠殑鍒嗛〉嫻嬭瘯錛屾晥鐜囨瘮浠ュ墠緗戜笂鑳藉鎵懼埌鐨勬渶濂界殑瀛樺偍榪囩▼錛堜釜浜烘剰瑙侊級(jí)紼嶉珮銆?br />浣嗘槸榪樻槸姣斿悓鏍風(fēng)殑Oralce鐨勫垎欏墊晥鐜囦綆銆?/p>
涓嬮潰鎴戝氨鐗涘垁灝忚瘯錛屽仛涓猟emo鐪嬬湅銆?/p>
1. 鍏堜笅杞絃inQ妗嗘灦聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)鐜板湪鏈鏂扮増鏈槸2006騫?鏈堝彂甯?Orcas CTP", 涓嬭澆鍦板潃(榪欓噷 )
2. 涓嬭澆瀹夎寰呭畬姣曘?/p>
3. 鏂板緩涓涓?LINQ Console Application"欏圭洰銆?/p>
4. 杈撳叆浠g爜濡備笅錛毬?tīng)聽(tīng)?
榪愯緇撴灉濡備笅錛?br />Hello
World
print any key to continue ...
ICallbackEventHandler瀛樺湪浜嶴ystem.Web.UI涓紝鎴戜滑鍏堝仛涓涓潪甯哥畝鍗曠殑渚嬪瓙鏉ヨ瘯鐢ㄤ竴涓嬨?/p>
聽(tīng)聽(tīng) 絎竴姝ワ紝鍦╒S2005涓緩绔嬩竴涓柊鐨刉EB紿椾歡銆?br />聽(tīng)聽(tīng) 絎簩姝ワ紝鍦ˋSPX涓紝鏀句笂涓孌礖TML浠g爜(濡備笅)錛?br />
聽(tīng)聽(tīng) 絎笁姝ワ紝鐒跺悗鍦?lt;HEAD></HEAD>涓斁鍏ヤ竴孌礘avaScript鑴氭湰錛?br />
聽(tīng)
聽(tīng)聽(tīng) 絎洓姝ワ紝鍦ㄦASPX鐨勫悗鍙癈S浠g爜涓紝緇ф壙ICallbackEventHandler鎺ュ彛錛屽茍瀹炵幇鎺ュ彛涓殑涓や釜鏂規(guī)硶錛?br />聽(tīng)I(yíng)CallbackEventHandler.GetCallbackResult()
聽(tīng)聽(tīng)聽(tīng) 鍜?br />聽(tīng)I(yíng)CallbackEventHandler.RaiseCallbackEvent(string eventArgument)
聽(tīng)聽(tīng) 絎簲姝ワ紝澧炲姞涓涓彉閲廋allBackValue錛屽茍淇敼鎺ュ彛鐨勪袱涓柟娉曚負(fù)錛?br />
聽(tīng)
聽(tīng)聽(tīng)聽(tīng) 絎叚姝ワ紝榪愯錛岀晫闈笂浼?xì)鍑虹庮C竴涓寜閽紝鐐瑰嚮鍚庯紝浼?xì)灏嗏滄祴璇曗濊繖涓瓧絎︿覆浼犺嚦鍚庡彴錛屽悗鍙癈#浠g爜灝嗗瓧絎︿覆鍔犱笂鈥滐紝OK鈥濆悗榪斿洖緇欏鎴風(fēng)鐨凧avaScript浠g爜錛屽茍鏄劇ず銆?/p>
聽(tīng)聽(tīng)聽(tīng) 浠ヤ笂鍏錛屽氨鍙互瀹炵幇鏃犲埛鏂板洖璋冧簡(jiǎn)銆傜幇鍦紝鎴戜滑鏉ュ垎鏋愪竴涓嬪嚑孌典唬鐮併?br />聽(tīng)聽(tīng)聽(tīng) 鍏堢湅絎笁姝ヤ腑鐨凧avaScript浠g爜錛屽叾涓殑CallServer()鏂規(guī)硶涓繘琛屼簡(jiǎn)鍥炶皟錛屽洖璋冪殑璇彞涓猴細(xì)
<%= ClientScript.GetCallbackEventReference(this, "product", "ReceiveServerData",null)%>;
聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng) 閲岄潰鍥涗釜鍙傛暟涓浜屼釜鍙傛暟鎸囧畾灝唒roduct榪欎釜JavaScript涓殑瀛楃涓插彉閲忎紶鍥炲悗鍙幫紝絎笁涓弬鏁版寚瀹氫簡(jiǎn)浠庡悗鍙拌繑鍥炴椂鎺ユ敹榪斿洖淇℃伅鐨凧avaScript鏂規(guī)硶ReceiveServerData(string Value)銆?/p>
聽(tīng)聽(tīng)聽(tīng) 絎簲姝ヤ腑鍚庡彴鐨勪袱涓柟娉曪紝涓涓狪CallbackEventHandler.RaiseCallbackEvent(string eventArgument)鐢ㄦ潵鎺ユ敹鍓嶅彴JavaScript涓紶鏉ョ殑瀛楃涓插彉閲忥紝騫惰祴鍊肩粰鍐呴儴鍙橀噺this.CallBackValue錛屽彟涓涓柟娉旾CallbackEventHandler.GetCallbackResult()灝嗗彉鏇村悗鐨勫唴閮ㄥ彉閲弔his.CallBackValue榪斿洖緇欏墠鍙癑avaScript鏂規(guī)硶ReceiveServerData(string Value)銆?/p>
聽(tīng)聽(tīng)聽(tīng) 璋冪敤鐨勯『搴忔槸錛?(鍓嶅彴)CallServer() --> (鍚庡彴)ICallbackEventHandler.RaiseCallbackEvent(string eventArgument) --> (鍚庡彴)ICallbackEventHandler.GetCallbackResult() --> (鍓嶅彴)ReceiveServerData(string Value)銆?/p>
聽(tīng)聽(tīng)聽(tīng) 鏁翠釜璋冪敤榪囩▼闈炲父綆鍗曪紝鑰屽叾涓潪甯稿叧閿殑涓姝ユ槸絎笁姝ョ殑
<%= ClientScript.GetCallbackEventReference(this, "product", "ReceiveServerData",null)%>;
榪欎釜鏂規(guī)硶錛屼互涓嬫槸浠庣綉涓婃壘鏉ョ殑涓孌佃祫鏂欙紝澶у鍙互鐪嬬湅銆?/p>
GetCallbackEventReference浣垮緱瀹㈡埛绔柟娉曞湪瀹㈡埛绔姹傜粨鏉熸椂寰楀埌鍥炴敹銆?瀹冧篃璁〤allBackManager 紜畾浜х敓鍝鍥炲彨鏂規(guī)硶銆?鍦ㄨ繖涓緥瀛愬唴浣跨敤鐨勮閲嶈澆鐨勬柟娉曟槸錛?/p>
聽(tīng)聽(tīng) public string GetCallbackEventReference(
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) string target, string argument,
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) string clientCallback, string聽(tīng) context,
string clientErrorCallback)
Table 1. GetCallBackEventReference 鏂規(guī)硶鐨勫弬鏁版弿榪般?br />Parameters Description target ID of the page where the callback invocation is handled. For more see the other overloaded options available in the next immediate section.In our sample "this" is the argument value, since the callback is handled in the same page.聽(tīng) argument This is the parameter defintion used to send value to the server. This value is received by parameter "eventArgument" at the server end using the RaiseCallbackEvent event."arg" becomes the first parameter name in our sample. The value is passed through this argument from the client. clientCallback Method name of the callback that is invoked after successful server call."CallBackHandler" is the method name that handles the callback.聽(tīng)聽(tīng) context A parameter that is associated with the "argument" from the client. It usually should be used to identify the context of the call. You will understand this better from the sample implementation.In the sample "ctx" is just another parameter definition used. The value for this is passed from the client. clientErrorCallback Name of the method that is called from the CallBackManager in case of any errors.
浠庤繖涓柟娉曡繑鍥炵殑string鏄?
聽(tīng)聽(tīng)
聽(tīng)聽(tīng) __doCallback('__Page',arg,CallBackHandler,ctx, ErrorCallBack)
聽(tīng)
鍙︿竴涓噸杞芥柟娉曟槸:
聽(tīng)聽(tīng) public string GetCallbackEventReference(
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) Control control, string argument,
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) string clientCallback, string聽(tīng) context)
聽(tīng)聽(tīng)
聽(tīng)聽(tīng) public string GetCallbackEventReference(
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) Control control, string argument,
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) string clientCallback,聽(tīng) string聽(tīng) context,
string clientErrorCallback)