select *,//全部查询
sum(profit) over (order by profit_date) as cumulative_profit//对利润求和 按照日期顺序排序 重命名cumulative_profit
from daily_profits 
order by profit_date //按照日期排序