是否可以在LAST_VALUE
select语句中使用GROUP BY
关键字?
SELECT colA,
LAST_VALUE(colB)
OVER (PARTITION BY ... ORDER BY ... ROWS BETWEEN ...)
FROM MyTable
GROUP BY colA
答案 0 :(得分:0)
我不认为window
功能可用于group by
。可能sub-select
将完成工作
select colA,L_values
from
(
SELECT colA,
LAST_VALUE(colB)
OVER (PARTITION BY ... ORDER BY ... ROWS BETWEEN ...) L_Value
FROM MyTable
) a
group by colA,L_values