I have 2 queries below and I would like to join them to give a single result.
Table 1 has more postcodes than table 2 and I would like to list the super-set of all postcodes in the left hand column and if table 2 doesn't have a result for that particular postcode it would show zero.
Here is an example of the desired output.
Postcode Count1 Count2
SW 200 57
LS 400 0
PH 250 23
Can you help?
SELECT `postcode`, COUNT( * ) AS Count1 FROM `table1` GROUP BY `postcode`;
SELECT `postcode`, COUNT( * ) AS Count2 FROM `table2` GROUP BY `postcode`;