Code:
SELECT DISTINCT broker, COUNT(case when cntsze=20 then cntsze end) as '20', COUNT(case when cntsze=40 then cntsze end) as '40', COUNT(case when cntsze=45 then cntsze end) as '45' FROM CYMgps WHERE ( sysdte BETWEEN '2012-11-01 00:00:00' and '2012-11-30 23:59:59') GROUP BY broker ORDER BY broker asc
Comment