close
DENSE_RANK() OVER(PARTITION BY XXX, YYY ORDER BY ZZZ )
RANK() OVER(PARTITION BY XXX, YYY ORDER BY ZZZ )
如果資料有 10, 10, 10, 20, 20, 30, 40...
用 DENSE_RANK() 會排出:1, 1, 1, 2, 2, 3, 4
用 RANK() 會排出:1, 1, 1, 4, 4, 6, 7
全站熱搜