我正在努力使用SQL排名函数。能帮我解决这个问题吗。
有没有可能得到我想要的专栏?
这是我的排名查询,最后一列是我的输出。我希望从第3列获得输出
RANK() OVER ( PARTITION BY col1 ORDER By col2)
col1 col2 "desired output" "current output"
A 1 1 1
A 1 1 1
A 1 1 1
A 1 1 1
A 1 1 1
A 5 2 6
B 3 1 1发布于 2015-08-28 23:05:47
DENSE_RANK() OVER ( PARTITION BY col1 ORDER By col2)不管怎么说,这就是答案。
https://stackoverflow.com/questions/32273647
复制相似问题