Datan du vill ha är antalet enheter som har mer än ett värde i en kolumn.
Detta beräknas enklast på kolumnbasis:
select sum(case when NumFirstNames <> 1 then 1 else 0 end) as DifferentFirstNames,
sum(case when NumLastNames <> 1 then 1 else 0 end) as DifferentLastNames,
sum(case when NumSSN <> 1 then 1 else 0 end) as DifferentSSN,
sum(case when NumPhone <> 1 then 1 else 0 end) as DifferentPhone
from (select EncounterId, count(*) as Num,
count(distinct FirstName) as NumFirstNames,
count(distinct LastName) as NumLastNames,
count(distinct SSN) as NumSSN,
count(distinct Phone) as NumPhone
from table t
group by EncounterId
) e;
Du kan formatera resultaten hur du vill.