此sql语句包括了两个聚合函数做除法求百分比,并保留两位小数,直接输出字符串形式的百分比.以及对case when在聚合函数的应用. SELECT ss.SS_NAME,SS_ID, COUNT(ea.EA_ID) AS EACounts,--回单交换单个数 COUNT(eb.EB_ID) AS EBCounts,--交换单个数 COUNT(ps.PS_ID) AS PSCounts,--签收单个数 COUNT(SW_ID) AS SWCounts,--运单数个数 THEN 'PS_ID' EN…