prueba esto
Código SQL:
Ver originalSELECT
(
CASE
WHEN clases LIKE '%A%'
THEN 'A'
WHEN clases LIKE '%B%'
THEN 'B'
WHEN clases LIKE '%C%'
THEN 'C'
WHEN clases LIKE '%D%'
THEN 'D'
WHEN clases LIKE '%E%'
THEN 'E'
WHEN clases LIKE '%F%'
THEN 'F'
WHEN clases LIKE '%G%'
THEN 'G'
ELSE
'NOTHING'
END
) AS clas,
SUM(total) AS suma
FROM
(
SELECT
denom_ap AS clases,
COUNT(*) AS total
FROM te02_licencias AS L
INNER JOIN ta01_clases_por_licencia AS CL
ON (L.id_licencia = CL.id_licencia)
INNER JOIN te03_clases AS C
ON (CL.id_clase = C.id_clase)
GROUP BY Clases
) AS resultado
GROUP BY clas
ORDER BY clas;
saludos