Now my output would like to be
x
total_rows | completed | incomplete
------------------------------------
7 2 5
How can I achieve that.
Advertisement
Answer
You could use condition aggregation
select count(*) total ,
sum(completed = 1) completed ,
sum(completed = 0) incompleted
from your_table