How do I count the number of countries separately into different columns using queries in SQL?
All the countries in column:
Countries
US
Spain
Germany
US
Mexico
The country totals to display as:
Mexico 1 USA 2 Spain 1 Germany 1
I'm trying to use a query like this:
SELECT COUNT(Country) AS 'Mexico', COUNT(Country) AS 'USA', COUNT(Country) AS 'Spain', COUNT(Country) AS 'Germany'
FROM Customers
WHERE Country='Mexico' AND Country='US' AND Country='Spain' AND Country='Germany';
The result displayed as:
Mexico 0 USA 0 Spain 0 Germany 0
Anyone help me out here?