I want following output in mysql using single query from single table.
Total Pending Critical Completed
120 45 45 30
right now I am doing using 4 queries for for different column like
select count(*) total from Y; -- for first column
select count(*) as Pending from Y where status = 0--- for second column
select count(*) as critical from Y where type = 'Critical' -- for third column
What I want, I want this in single query something like
select count(*) as total,count(*) pending where XYZ,
I am not getting what to write in where because conditions are different for each output, if we write
select count(*) as total,count(*) pending where status = 0
then it gives
total pending
45 45
but I want
total pending
120 45
Please help me,