背景
晚上看sql 基础教程的时候看到的示例,在电脑上写出后一直报错
select product_id,product_name,sale_price,
sum(sale_price) over(partition by product_type order by product_price) as current_sum
from product;
select product_id,product_name,sale_price,
avg(sale_price) over(order by product_id) as current_avg
from product;
运行结果及报错内容
消息 102,级别 15,状态 1,第 2 行
'order' 附近有语法错误。
两个语句的报错内容都已order 处有语法错误,但是不懂是怎么回事。希望可以得到解答。