Good evening, I have generated two queries to a PostgreSQL database, which are the following:
SELECT tarea, count(estado) AS "TotalCompletos" from tabla WHERE estado = 'Completo' GROUP BY tarea;
SELECT tarea, count(estado) AS "TotalIncompletos" from tabla WHERE estado = 'Incompleto' GROUP BY tarea;
My question is, how can I merge the above two queries into one query in order to produce a result similar to the following?
I have used UNION but I do not get the expected results. Attached is some sample code from the database I am using: Demo_DB