N
N
NordeN32019-06-12 14:09:39
SQL
NordeN3, 2019-06-12 14:09:39

SQL query for filter?

There is a table of users with the following structure:
id - integer primary key of sequential numbering
username - user login
city_id - user's city of residence It is
necessary to select cities where at least N users live.
Help with this request, thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery, 2019-06-12
@Desay

select city_id, count(id) as kolvo
from table
having count(id)>= 5--N - пользователей

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question