SELECT Sungero_Core_Recipient.Name AS Addressee,
dev_Kemero1_CityDistricts.Name AS District
FROM [Sungero_Content_EDoc]
JOIN dev_Kemero1_CityDistricts ON dev_Kemero1_CityDistricts.Id = [Sungero_Content_EDoc].Districtdev_Kemerov_dev
JOIN Sungero_Core_Recipient ON Sungero_Core_Recipient.Id = [Sungero_Content_EDoc].InAddressee_Docflow_Sungero
WHERE [Sungero_Content_EDoc].Name LIKE 'Обращение%'
Addressee District
Белкина Валентина Михайловна Заводский
Белкина Валентина Михайловна Заводский
Addressee District Count
Белкина Валентина Михайловна Заводский 1
Белкина Валентина Михайловна Заводский 1
Addressee District Count
Белкина Валентина Михайловна Заводский 2
SELECT Sungero_Core_Recipient.Name AS Addressee,
dev_Kemero1_CityDistricts.Name AS District,
1 AS [Count]
FROM [Sungero_Content_EDoc]
JOIN dev_Kemero1_CityDistricts ON dev_Kemero1_CityDistricts.Id = [Sungero_Content_EDoc].Districtdev_Kemerov_dev
JOIN Sungero_Core_Recipient ON Sungero_Core_Recipient.Id = [Sungero_Content_EDoc].InAddressee_Docflow_Sungero
WHERE [Sungero_Content_EDoc].Name LIKE 'Обращение%'
SELECT Sungero_Core_Recipient.Name AS Addressee,
dev_Kemero1_CityDistricts.Name AS District,
COUNT(*) AS [Count]
FROM [Sungero_Content_EDoc]
JOIN dev_Kemero1_CityDistricts ON dev_Kemero1_CityDistricts.Id = [Sungero_Content_EDoc].Districtdev_Kemerov_dev
JOIN Sungero_Core_Recipient ON Sungero_Core_Recipient.Id = [Sungero_Content_EDoc].InAddressee_Docflow_Sungero
WHERE [Sungero_Content_EDoc].Name LIKE 'Обращение%'
GROUP BY Sungero_Core_Recipient.Name, dev_Kemero1_CityDistricts.Name