select * from tbls --这是原表
select *,
(select SUM(占比) from
(select 品牌描叙,销售额,销售额/(select SUM(销售额) from tbls) as 占比 ,rank()over(ORDER BY 销售额 DESC) as 排序 from tbls) as tem
where tem.排序<=tbl.排序
) as 占比累计
from
(select rank()over(ORDER BY 销售额 DESC) as 排序,品牌描叙,销售额
from tbls) as tbl
--------------
新手,水平有限,百度应该有比较标准的sql写法