rank时提示Unrecognized column name ascending

我查了用户手册有关rank的用法,执行下面语句时出错如下图:

attachments-2021-07-ZzPPahGx60eff55b01b0f.png

请先 登录 后评论

1 个回答

wale

手册中rank用法:

rank(X, [ascending=true], [groupNum], [ignoreNA=true], [tiesMethod=’min’])

中括号表示可选参数,上述代码中把中括号去掉,10改成groupNum=10就可以了

select rank(close, ascending=true,groupNum=10,tiesMethod='min') from t context by ticker



请先 登录 后评论