Ошибка в mysql коде

SELECT 'Кол-во абонентов 1"' AS `Показатель`, COUNT(DISTINCT Subscriber_idSubscriber) AS `Всего` FROM
(
  SELECT idPlan, Communication_idCommunication
  FROM Plan
  WHERE Communication_idCommunication = 2 AND CommunicationDetails_idCommDetails = 2
) AS A
INNER JOIN Subscriptions AS B ON A.idPlan = B.Plan_idPlan;
UNION ALL
SELECT 'Количество абонентов 2' AS `Показатель`, COUNT(DISTINCT Subscriber_idSubscriber) AS `Всего` FROM
(
  SELECT idPlan, Communication_idCommunication
  FROM Plan
  WHERE Communication_idCommunication = 3
) AS A
INNER JOIN Subscriptions AS B ON A.idPlan = B.Plan_idPlan;

Выдаёт ошибку. Как её исправить? Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION ALL SELECT 'Количество абонентов 1' at line 1 0.000 sec


Ответы (0 шт):