I have two queries that I'm grouping to get the account.
Is it possible make it in one query using the dept_id column, some of the ID's may no exist in both queries.
The output like this:
dept_id | totalstars | totalstarsgiven
Query:
SELECT
employeedept as dept_id,
COUNT(*) as 'totalstars'
FROM
Responses a
WHERE
execoffice_status = 1
AND YEAR ([approveddate]) = 2015
AND MONTH ([approveddate]) = 11
and employeedept not in (22,16)
GROUP BY
execoffice_status, employeedept
SELECT
a.submitterdept as dept_id,
COUNT(*) as 'totalstarsgiven'
FROM
Responses a
WHERE
execoffice_status = 1
AND YEAR ([approveddate]) = 2015
AND MONTH ([approveddate]) = 11
GROUP BY
execoffice_status, submitterdept