0
I wonder how I could make one SELECT
where I can bring the same resulting however in a single SELECT
.
Example of the select I need to be single:
SELECT COUNT(*) AS QtdTarifados
FROM tblLoteTESTE
WHERE CodCampanha = 1
AND MONTH(DataAgendada) = 7
AND YEAR(DataAgendada) = 2018
AND FlagTarifado = 1
SELECT COUNT(*) AS QtdEnviados
FROM tblLoteTESTE
WHERE CodCampanha = 1
AND MONTH(DataAgendada) = 7
AND YEAR(DataAgendada) = 2018
AND FlagEnviado = 1
SELECT COUNT(*) AS QtdRespondidos
FROM tblLoteTESTE
WHERE CodCampanha = 1
AND MONTH(DataAgendada) = 7
AND YEAR(DataAgendada) = 2018
AND FlagRespondido = 1
Could you help me?
Have you tried
UNION
? Knows how to?– Ricardo Pontual
You can use all your selects as subselects of a main.
– TonCunha