在Northwind数据库中运行:
SELECT
ROW_NUMBER() OVER(ORDER BY CustomerID desc) as z1,
RANK() OVER(ORDER BY CustomerID asc) as z2,
DENSE_RANK() OVER(ORDER BY CustomerID asc) as z3,
NTILE(4) OVER(ORDER BY CustomerID asc) as z4,
CustomerID, City from Customers
ORDER BY CustomerID asc
查看结果,选择所需要的种类。