0
Well, I’m performing a select between two dates that returns me two values.
Quantity of purchases paid in CASH.
Amount of purchases paid by credit card.
I’m doing it this way,
SELECT COUNT(FORMA_PAGAMENTO) AS 'DINHEIRO' FROM ESTOQUE WHERE FORMA_PAGAMENTO = 'dinheiro' AND DATA BETWEEN '2020-01-01' AND '2020-02-13'
UNION
SELECT (COUNT(FORMA_PAGAMENTO) AS 'CARTÃO DE CREDITO' FROM ESTOQUE WHERE FORMA_PAGAMENTO = 'Cartão de Crédito' AND DATA BETWEEN '2020-01-01' AND '2020-02-13';
The problem is that it’s returning me the two values in the same column, and I need it to be in different fields:
**DINHEIRO** **CARTÃO DE CREDITO**
X Y
I did several searches and did not find anything related. The table that is being performed the select has no relationship.
As the best answer has already been chosen, I will give just a hint from the forum. Your question tags are "javascript" and "php", but it only concerns SQL derivatives.
– Matheus Franco