Query in sql database

As we find the 2 most populated cities, where not. customers are higher than any other

+3
source share
1 answer

Assuming your circuit looks like this:

Customers
  -City
  -SSN

You can simply use limit:

select City, count(SSN)
from Customers
group by City
order by count(SSN) desc
limit 2
+3
source

Source: https://habr.com/ru/post/1768920/


All Articles