注意:当前为视频教学,文本教学可在视频下方查看!
生产计划语句:
persent2=case isnull((select count(1) from sdym033 where ym03302=ym00501),0) when 0 then 0 else cast((select count(1) from sdym033 where ym03302=ym00501 and isnull(ym03308,0)>=isnull(ym03306,0)) as decimal(18,6))/isnull((select count(1) from sdym033 where ym03302=ym00501),0)*100 end
加工单语句:
persent2=case isnull((select count(1) from sdym034 where ym03402=ym00601),0) when 0 then 0 else cast((select count(1) from sdym034 where ym03402=ym00601 and isnull(ym03406,0)>=isnull(ym03404,0)) as decimal(18,6))/isnull((select count(1) from sdym034 where ym03402=ym00601),0)*100 end
生产计划语句:
persent2=case isnull((select count(1) from sdym033 where ym03302=ym00501),0) when 0 then 0 else cast(isnull((select count(1) from sdym033 where ym03302=ym00501 and isnull(ym03308,0)>=isnull(ym03306,0)),0)*(1.000000/(select count(1) from sdym033 where ym03302=ym00501))*100 +isnull((select sum(ym03308/ym03306) from sdym033 where ym03302=ym00501 and isnull(ym03308,0)
加工单语句:
persent2=case isnull((select count(1) from sdym034 where ym03402=ym00601),0) when 0 then 0 else cast(isnull((select count(1) from sdym034 where ym03402=ym00601 and isnull(ym03406,0)>=isnull(ym03404,0)),0)*(1.000000/(select count(1) from sdym034 where ym03402=ym00601))*100 +isnull((select sum(ym03406/ym03404) from sdym034 where ym03402=ym00601 and isnull(ym03406,0)









