思路不对,不应该除以总数量吧,这样完成率永远达不到100%
完成率应该是工序完成数量/工序接单数量
select t1.工序,t1.c,t1.a*1.0/t2.a as 完成率
from
(select process_name 工序,to_char(buste_time,'MM-DD') c ,
count(to_char(buste_time,'MM-DD')) a
from public.mes_buste_page
group by to_char(buste_time,'MM-DD'),process_name) t1
inner join (
select to_char(buste_time,'MM-DD') c ,count(to_char(buste_time,'MM-DD')) a
from public.mes_buste_page
group by to_char(buste_time,'MM-DD')) t2 on t1.c=t2.c