[ORACLE]COUNT DECODE

Database 2018.06.04 09:23 Posted by 애플자라

SELECT '신청: '||TOTAL||'건(전체), '||P_TYPE||'건(PC), '||M_TYPE||'건(모바일)' AS EVENT_M

FROM

(

SELECT COUNT (1) AS TOTAL,

       COUNT (DECODE (TYPE, 'P', 'P')) AS P_TYPE,

       COUNT (DECODE (TYPE, 'M', 'M')) AS M_TYPE

  FROM N_BOARD_EVENT

)