I\'m trying to get more columns summarizing the result from 2 different tables
SET @start_res = 20150301; SET @finish_res= 20150501; SET @finish_check= 20150
In SQL Server 2005+, you can use Window functions. But it isn't supported in MySQL.
In Subquery, select statements must have join operator. Like this:
SELECT * FROM ( (SELECT COUNT(..) ...) AS C1 INNER JOIN (SELECT COUNT(...) ...) AS C2 ON INNER JOIN ... )