Good morning, I'm redoing the question because the last one I deleted because it was a bit confusing.
I have these two select and would like to join them to return the result for a comparison chart.
This SELECT query and returns me the number of maintenances you had per month
SELECT
DATE(MAN.relManu_data_registro) AS DATA,
count(MAN.relManu_id) AS TOTAL_MAN
FROM tb_relatorio_manutencao AS MAN
WHERE
MAN.relManu_data_registro >= DATE(date_sub(now(), interval 1 MONTH))
GROUP BY DAY(MAN.relManu_data_registro) ORDER BY MAN.relManu_data_registro ASC
This SELECT query and returns me the number of connections you had per month
SELECT
DATE(LIG.ligacoes_data_registro) AS DATA,
count(LIG.ligacoes_id) AS TOTAL_LIG
FROM tb_relatorio_ligacoes AS LIG
WHERE
LIG.ligacoes_data_registro >= DATE(date_sub(now(), interval 1 YEAR)) AND
LIG.ligacoes_assunto >= suporte
GROUP BY MONTH(LIG.ligacoes_data_registro)
ORDER BY LIG.ligacoes_data_registro ASC
So, in the first select I select the maintenances and count how many I had in the month, in the second I consult another table and get how many calls to the support had per month.
I wanted to merge these queries to stay on the same line of DATE MONTH, CONNECT COUNT, SUPPORT COUNT to compare on a chart.