这是原始脚本
select c.c_fundname,
c.c_fundcode,
b.c_custname,
sum(e.f_shares),
sum(e.f_shares) * 100 / sum(e.f_shares) over(PARTITION BY c.c_fundcode order by c.c_fundcode) 比例
from vtrustcontractdetails a,
vaccoinfo b,
tfundinfo c,
tcontractsharestat e
where a.c_fundcode = c.c_fundcode
and a.c_fundacco = b.c_fundacco
and a.l_serialno = e.l_contractserialno
group by c.c_fundcode, c.c_fundname, b.c_custname, b.c_identityno
order by sum(e.f_shares) desc