sql连续排序DENSE_RANK,算出得分(并列第一)
sql连续排序DENSE_RANK,算出得分(并列第一)
2018年07月18日 13:42:21 Anticlimax丶 阅读数 474
版权声明:本文为博主原创文章,需要转载尽管转载。 https://blog.csdn.net/z5976749/article/details/81096703
SELECT creatordepid, DENSE_RANK() OVER (ORDER BY COUNT(creatordepid) DESC) AS MC,
CASE DENSE_RANK() OVER (ORDER BY COUNT(creatordepid) DESC)
WHEN 1 THEN
100
ELSE
100 - (DENSE_RANK() OVER (ORDER BY COUNT(creatordepid) DESC) - 1) * 5
END FS
FROM destask GROUP BY creatordepid