SELECT state, sum(IF(month(identifier)=1,1,0)) as 'Jan', sum(IF(month(identifier)=2,1,0)) as 'Feb', sum(IF(month(identifier)=3,1,0)) as 'Mar', count(*) as TOTAL from contacts WHERE state != '' GROUP BY state;