select round(sum(case when o.close_date is null then 1 else 0 end)/count(*),3)*100||'%' SCALE from order o
说明:使用sum对一定条件的数据求和后,与总数进行比较。
||'%' 为以的百分号形式输出结果(例:2%)
select round(sum(case when o.close_date is null then 1 else 0 end)/count(*),3)*100||'%' SCALE from order o
说明:使用sum对一定条件的数据求和后,与总数进行比较。
||'%' 为以的百分号形式输出结果(例:2%)