ms sql 2008 R2 입니다.
with test as
(
select 1 as idx, 1000 as price
union all
select 2, 3000
union all
select 3, 500
union all
select 4, 1500
union all
select 5, 2000
)
select SUM(price) over (order by idx) from test
order by idx asc;
이걸 돌렸는데..
'order' 근처의 구문이 잘못되었습니다.
라고 나옵니다....
쿼리를 잘못 한건가요? 아님... 2008에서는 지원을 안하는 건가요?;;
Comment 1
-
이리
2018.01.23 10:58
sum over(order by) 는 2012부터 지원하는걸로 알고 있습니다.