Its been a long time since I last used SQL and I'm tearing my hair out trying to figure out how to do this so any help would be appreciated.
I have two tables, Updates and Alerts, which both contain a field called Site (which just contains the address of a web site and will contain duplicate values in both tables). I need to output three columns, the address of every site in both tables, the number of times it appears in the Updates table and the number of times it appears in the Alerts table.
So if I had the following
Updates
---------------
Site1
Site1
Site1
Site2
Site4
Site5
Alerts
--------------
Site1
Site2
Site2
Site3
Site4
Site4
The query would output
Site | Updates | Alerts
----------------------------------
Site1 | 3 | 1
Site2 | 1 | 2
Site3 | 0 | 1
Site4 | 1 | 2
Site5 | 1 | 0
Any help would be very much appreciated
I have two tables, Updates and Alerts, which both contain a field called Site (which just contains the address of a web site and will contain duplicate values in both tables). I need to output three columns, the address of every site in both tables, the number of times it appears in the Updates table and the number of times it appears in the Alerts table.
So if I had the following
Updates
---------------
Site1
Site1
Site1
Site2
Site4
Site5
Alerts
--------------
Site1
Site2
Site2
Site3
Site4
Site4
The query would output
Site | Updates | Alerts
----------------------------------
Site1 | 3 | 1
Site2 | 1 | 2
Site3 | 0 | 1
Site4 | 1 | 2
Site5 | 1 | 0
Any help would be very much appreciated