Вы можете использовать выбранный регистр, как этот
SELECT
mobileNumber,
SUM(CASE WHEN (statusName='unattended') THEN 1 ELSE 0 END) AS unattended,
SUM(CASE WHEN (statusName='closed' ) THEN 1 ELSE 0 END) AS closed,
SUM(CASE WHEN (statusName='NotApplicable') THEN 1 ELSE 0 END) AS NotApplicable,
SUM(CASE WHEN (statusName='Assigned') THEN 1 ELSE 0 END) AS Assigned
FROM
MyTable
GROUP BY
mobileNumber
Пример кода DBFiddle
Вы можете использовать сводку.пример запроса
SELECT [unattended], [closed],[NotApplicable],[Assigned],[open] FROM
(SELECT [mobileNumber],[status] FROM MyTable )Tab1
PIVOT
(
COUNT([mobileNumber]) FOR status IN ([unattended], [closed],[NotApplicable],
[Assigned],[open])) AS Tab2
Пример кода DB Fiddle