我有一个简单的总和:sum(table.quantity) over (order by table.[Item No_] asc,table.[Entry No_] desc)
有two列,这项工作正常,但仅适用于一个[Item No _]
我需要它来计算用同一张表划分的许多[项目编号]的总和
您想要partition by
。我猜:
sum(table.quantity) over (partition by by table.[Item No_] order by table.[Entry No_] desc)