SELECT DATE(dateissued) AS date , SUM(amount) AS total_collection1 Where accountcodeid = '44' , SUM(amount) AS total_collection2 Where accountcodeid = '40' FROM payment GROUP BY dateissued ORDER BY dateissued DESC LIMIT 10
Advertisement
Answer
No but
SUM(case when accountcodeid = '44' then amount else 0 end) AS total_collection1
is valid