I have finally succeeded in summing the results of two sql sum queries. One small step for this guy:)
My question relates to the last character in the code (Z):
SELECT SUM(hr)
FROM (SELECT SUM(amount) AS hr
FROM Try_again.dbo.tuesday_practice_database
WHERE account_name LIKE 'concessions'
UNION
SELECT SUM(amount) AS hr
FROM Try_again.dbo.tuesday_practice_database
WHERE account_name LIKE 'salaries')Z
The code won't work unless there is something following the closing parenthesis).
I'm just curious why that is and why does there need to be a character following the ).
It seems that it doesn't matter what the character is, the code will work. But the code breaks if I leave it blank.
Thank you