I have two tables where common column is location,i am looking for the count of the locations from both the tables and display a combined count.
Table-1
+-------------+
| Location |
+-------------+
| USA |
| INDIA |
| UK |
| INDIA |
+-------------+
Table -2
+-------------+
| Location |
+-------------+
| INDIA |
| INDIA |
| USA |
+-------------+
Here the count from table one is :
+-------------+--------+
| Location | COUNT |
+-------------+--------+
| USA | 1 |
| INDIA | 2 |
| UK | 1 |
+-------------+--------+
Count from table 2 is :
+-------------+--------+
| Location | COUNT |
+-------------+--------+
| USA | 1 |
| INDIA | 2 |
+-------------+--------+
This count am getting by :
SELECT Location, COUNT(*) AS COUNT FROM Table-1 GROUP BY Location;
SELECT Location, COUNT(*) AS COUNT FROM Table-2 GROUP BY Location;
But i want the combined count from the two tables which looks like:
+-------------+--------+
| Location | COUNT |
+-------------+--------+
| USA | 2 |
| INDIA | 4 |
| UK | 1 |
+-------------+--------+
Thank you in advance.