Ver originalSELECT TIPO, SUM(PUB), SUM(PRI)FROM(SELECT TIPO, CASE WHEN CARACTER = 'Público' THEN '1' ELSE '0' END AS PUB,CASE WHEN CARACTER = 'Privado' THEN '1' ELSE '0' END AS PRIFROM TIPOS) AS MITABLAGROUP BY TIPO