I have these tables:
Client:
cliente
-------
id nome
id_municipio
Municipality:
municipio
-------
id
nome
Regional:
regional
-------
id
nome
Regional_municipality:
regional_municipio
-------
id_municipio
id_regional
In the regional_municipio
table I put, for example, municipality 17 refers to the regional 1
I need to make a select
that gives a count
of client per regional.
For example:
- regional 1 has 500 clients
- regional 2 has 50 clients
- regional 3 has 100 clients
Since in the client table I only have the number of the municipality, how to do that?