I am working to sum columns of data by a given category e.g. public spend by country from my file expenditure
SELECT SUM(public spending) AS public spending,
country FROM expenditure
group by country
The above works but it’s also pulling through the columnn header with a null for the sum e.g.
Country | public spending |
---|---|
Australia | 1012 |
Belarus | 52 |
Country | null |
Denmark | 755 |
Is there anyway for country to only be as a column header and not in the data?
Thanks!
Expected a table with only the countries not the column header also
New contributor
SQLLearner89 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1