I have a user table, and in this table there is a field of the country in which these people are indicated (i.e. "Sweden", "Italy", ...). How can I make a SQL query to get something like:
Country Number
Sweden 10
Italy 50
... ...
Users select their countries from the list that I give them, but the list is really huge, so it would be nice to have an SQL query that can avoid using this list, that is, look in the database and return only those countries that are in the database, therefore that, for example, I do not have anyone from Barbados, even if I have this option in the country field of the registration form :)
Thanks in advance!
source
share