I want to count the amount of duplicate rows in two tables with one SQL query and wondering if this is possible. Here are the two queries:
select city, COUNT(city) as TOTALFOUND FROM SearchHistory GROUP BY city ORDER BY TOTALFOUND DESC LIMIT 0,2
This returns something like:
city TOTALFOUND
Ottawa 23
Toronto 15
Then I have another table with the exact same table structure and can get what I want with this:
select city, COUNT(city) as TOTALFOUND FROM MessagesSent GROUP BY city ORDER BY TOTALFOUND DESC LIMIT 0,2
This returns something like:
city TOTALFOUND
Ottawa 80
Toronto 45
I somehow want to have one query where the result would be:
This returns something like:
city TOTALFOUND
Ottawa 103
Toronto 60
Is this possible?