COUNT in postgresql

-2

In the example shown on the following link link , what should the query we do be like so that the result have 2 columns, the first being the 21 countries and the second being the number of clients in each country?

Thank you very much in advance.

Greetings.

    
asked by Á. Garzón 17.10.2018 в 13:37
source

1 answer

0

You have to use the GROUP BY clause: link

The query would be:

SELECT DISTINCT Country as Pais, COUNT(CustomerName) as Clientes
FROM Customers
GROUP BY Country
    
answered by 17.10.2018 в 13:54