标签:des style color width strong 数据
Teradata数据库中也有和oracle类似的分析函数,功能基本一样。示例如下:
SELECT * FROM salestbl ORDER BY 1,2; storeid prodid sales |
SELECT storeid, prodid, sales, RANK() OVER (ORDER BY sales DESC) AS Rank_Sales storeid prodid sales Rank_Sales
|
SELECT storeid, prodid, sales, RANK()
OVER (PARTITION BY storeid ORDER BY sales DESC)AS Rank_Sales FROM salestbl QUALIFY Rank_Sales <= 3 ; storeid prodid sales Rank_Sales |
SELECT Prodid, Sumsales, RANK( ) OVER (ORDER BY Sumsales DESC) AS "Ranking" Prodid Sumsales Ranking
|
SELECT itemid, salesdate, sales, RANK() OVER (ORDER BY sales DESC) AND itemid = 10
FROM daily_sales_2004; itemid salesdate sales Rank(sales)
|
SELECT itemid, salesdate, sales, ROW_NUMBER() OVER (ORDER BY sales DESC) itemid salesdate sales Row_Number()
|
Teradata 的rank() 和 row_number() 函数,布布扣,bubuko.com
Teradata 的rank() 和 row_number() 函数
标签:des style color width strong 数据
原文地址:http://www.cnblogs.com/toughhou/p/3793154.html