Data, která v podstatě chcete, je počet entit, které mají ve sloupci více než jednu hodnotu.
Nejjednodušeji se to vypočítá na základě sloupců:
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;
Výsledky můžete formátovat, jak chcete.