SELECT COUNT(*) AS AllCount,t.AssignedCount,(COUNT(*)-t.AssignedCount) AS UnassignedCountFROM 药品表jOIN( SELECT COUNT(*) AS AssignedCount FROM 质量分析分配表 )as t on 1=1group by t.AssignedCount