So I have the following SELECT statements:
SELECT COUNT(A.Award) AS US, SUBSTRING(CAST(M.Year as char(4)), 0 , 4) AS Decade
FROM Movies M, Awards A
WHERE {SOME WHERE CLAUSE}
GROUP BY Decade;
and
SELECT COUNT(*) AS Total, SUBSTRING(CAST(A2.Year as char(4)), 0 , 4) AS Decade
FROM Awards A2
WHERE {SOME WHERE CLAUSE}
GROUP BY Decade;
The first one is “generating” a table with columns (US, Decade) and the second one is “generating” another table with columns (Total, Decade). I want to join those two tables so that I get a table (US, Total, Decade). How can I do it?
Put them in subqueries and do a
JOIN: