I have 2 tables
MEN
Fname | City
------------
A | AA
B | BB
C | AA
D | AA
E | CC
Citys
City
----
AA
BB
CC
DD
EE
FF
I need a query that will count how many occurrences there are of each type, in each city (include city that not is in the main list)
something like
City | Count
------------
AA | 3
BB | 1
CC | 1
DD | 0
EE | 0
FF | 0
You need a right join;