SELECT ISNULL(tt1.name,tt3.name) AS name,tt1.接通,tt3.未接通 FROM (
SELECT name,COUNT(name) '接通' FROM (
SELECT * FROM test WHERE result='接通') t1
GROUP BY name)tt1
FULL JOIN
(
SELECT * FROM (
SELECT name,COUNT(name) '未接通' FROM (
SELECT * FROM test WHERE result='未接通') t2
GROUP BY name) tt2) tt3
ON tt1.NAME=tt3.NAME
写的有点麻烦,暂时没想出更好的方法