I have this 2 queries that I would like that could be retrieve in onw shot.
If I run both separately, they dont work.
SELECT
(SELECT count(id) FROM numeracao WHERE DATA >= '2022-01-01' AND DATA<='2022-12-31' GROUP BY MONTH(DATA)) AS A,
(SELECT SUM(revisoes) FROM numeracao WHERE DATA >= '2022-01-01' AND DATA<='2022-12-31' GROUP BY MONTH(DATA)) AS B ```
Hown can I retrieve both in one shot?
Thanks
2
Answers
You should use a single aggregation query:
You can use this query for get your results