我正在尝试获取Total_Paid列
Product Timestamp Paid Total_Paid
A 201801 12 36
A 201802 11 36
A 201803 13 36
B 201801 10 45
B 201802 15 45
B 201803 20 45
答案 0 :(得分:1)
您可以使用窗口功能。例如:
select
*,
sum(paid) over(partition by product) as total_paid
from t