I'm new to sql and I'm having trouble performing the sum total of values in a count , below the code:
SELECT A.Pais, count(*)
from Aeroportos A
left join Estacoes E
on A.Sigla = E.ICAO
where E.ICAO IS NULL
group by A.Pais
order by Pais;
I would like to have the sum of airports per country also have the total sum of airports, I tried to use SUM(count)
but gave the error:
ERROR: aggregate function calls can not be nested.