What I would do is take what you have, throw it in univot, and then delete all entries from 0.
select Type, Sum from ( SELECT SUM(CASE WHEN Status = 'R' THEN 1 ELSE 0 END) AS Ready, SUM(CASE WHEN Status = 'P' THEN 1 ELSE 0 END) AS Processing, SUM(CASE WHEN Status = 'C' THEN 1 ELSE 0 END) AS Complete, SUM(CASE WHEN Status = 'F' THEN 1 ELSE 0 END) AS Failed, SUM(CASE WHEN Status = 'E' THEN 1 ELSE 0 END) AS Error FROM MailDefinition ) a unpivot ( Sum for Type in ([Ready],[Processing],[Complete],[Failed],[Error]) ) u where Sum>0
This, of course, is due to a change in schedule.
source share