我有一個投資回報率比較表是這樣的: Month | ROI | 1 | 2 | 3 |
Jul | A | 1% |
Jul | B | 3% |
Jul | C | 2% |
Jun | A | 4% | 6% |
Jun | B | 5% | 7% |
Jun | C | 6% | 8% |
May | A | 2% | 4% | 7% |
May | C | 3% | 5%
試圖創建一個表格,其中包含按產品銷售的總數量,並選擇按日期分段的第三個銷售數量最高的產品。一直得到錯誤 無效列名 的別名我RANK() OVER聲明: select
RANK() OVER (PARTITION BY t3.orderdate order by t3.total_amt_ordered) as ranking,
t3.productid,
t3.ord