问题:求特定列中的值占总和的百分比。
select (sum(
case when deptno =10 then sal end)/sum(sal)
)*100 as pct
from emp;
问题:求特定列中的值占总和的百分比。
select (sum(
case when deptno =10 then sal end)/sum(sal)
)*100 as pct
from emp;
转载于:https://www.cnblogs.com/liang545621/p/7523283.html