ive尝试运行下一个查询
select sum(balance) over (partition by client order by card desc, date_tr desc)
from table_1
,因此我有下一个错误消息:
FAILED: SemanticException Range based Window Frame can have only 1 Sort key
是真的吗,我不能在order by
句子中使用2个排序键?或者有一种方法可以使用2个排序键?
您的代码应起作用。语言手册有一个非常相似的例子。
也就是说,明确的窗口子句可能会遇到错误:
select sum(balance) over (partition by client
order by card desc, date_tr desc
rows between unbounded preceding and current row
)
from table_1
请查看此答案,以了解小组和分区之间的区别,但它应该起作用,尽管这取决于您想要什么:差异组和分区
<</p>