Contents

1 SQL Server 2005 豢螳 Windowing Function
2 2012 伎 覯
3 Oracle Server Windowing Function


1 SQL Server 2005 豢螳 Windowing Function #

SQL Server 2005 襦蟆 覲伎 譴 譯朱 襷 螳 . 覦襦 Ranking (ROW_NUMBER()煙 襷 谿語^)企. 一 襯 覲伎.
USE AdventureWorks
GO

SELECT 
	i.ProductID
,	p.Name
,	i.LocationID
,	i.Quantity
,	RANK() OVER (PARTITION BY i.LocationID ORDER BY i.Quantity) AS RANK
FROM Production.ProductInventory i JOIN Production.Product p 
ON i.ProductID = p.ProductID
ORDER BY p.Name
GO
windowing_function01.jpg

ろ螻 覲企 襦呉 朱 蟆 覲伎 蟆企. 蠏碁殊 る 蟆豌 讌 螻一 蠍 伎 豢螳. 手 . 蠍一 襷 讌 覦襦 Window. Window襯 企至 磯殊 蟆郁骸讌 るゴ蟆 覦. 襴覃 れ螻 螳.

  1. RANK() Window伎 貉殊 襯 襷り襖譯朱 企.
  2. Window OVER() 讓曙 .
  3. OVER() 讓曙 PARTITION BY 蠏碁9 讌 蟆企.
  4. ORDER BY 蠏碁9 讌 企 蠍一朱 讌 蟆一.

讀, 覓語レ 覩碁
RANK() OVER (PARTITION BY i.LocationID ORDER BYi.Quantity) AS RANK
windowing_function02.jpg

覩瑚 . 讀, 覲襦 襯 襷り襖覲願る 詞企.

SQL Server 2005 RANK, NTILE, DENSE_RANK, ROW_NUMBER 螳 4螳 Windowing Function 螻牛. 襷 朱 襷襦 覲企ゼ 螻牛螻 . 伎 覯 豌伎 襯 至鍵 曙襷 れ 蠏碁9覲 襯 至鍵螳 曙襷 . SQL 覲旧″螻, 焔ル 襦 れ . 伎 2005 覯 襯 伎覃 所, 觜襯願 蟆郁骸襯 覲 . 襷 Windowing Function るΜ 蠍磯襯 讌襷 4螳襯 螻牛, 讌 る . 讌襷 蠏碁 願 企瑚? 蟆 覲企る . SQL 讌.

2 2012 伎 覯 #

2012 伎 覯 SQL Server Analysis Function襯 谿瑚.

3 Oracle Server Windowing Function #

Oracle Server 蟆曙磯 覿 伎 覓語襯 谿瑚覃 . 企 Oracle8i(8.1.6)伎 . れ 伎覃 SQL 覓企 讌. 襷 企 Oracle SQL覓語 燕 蟆 るジ DBMS覲企 企給り る 蠏 蟇一襷願碓 企.