ÄãtimedayµÄÊý¾Ý¸ñʽ»á²»»áÓÐÎÊÌâ¡£¡£
ÊÔÊԸijÉ
SELECT * from(SELECT system,
to_char(TIMEDAY,'yyyyMM') TIMEDAY,
CATEGORY,
COUNT (CASE WHEN state = '¹Ø±Õ' THEN '¹Ø±Õ' ELSE NULL END) ¹Ø±ÕÊý,
COUNT (CASE WHEN state = 'ÕýÔÚ½øÐÐ' THEN 'ÕýÔÚ½øÐÐ' ELSE NULL END) ÕýÔÚ½øÐÐÊý,
COUNT (CASE WHEN state = '³¬Ê±' THEN '³¬Ê±' ELSE NULL END) ³¬Ê±Êý,
COUNT (CASE WHEN state = 'ÑÓÆÚÍê³É' THEN 'ÑÓÆÚÍê³É' ELSE NULL END) ÑÓÆÚÍê³ÉÊý
FROM table GROUP BY system,TIMEDAY,CATEGORY)
where TIMEDAY ='${ym}' and CATEGORY='${leibie}'