SUM(SPEC1)+SUM(SPEC2)+SUM(SPEC3)+SUM(SPEC4)+SUM(SPEC5)+SUM(SPEC6)+SUM(SPEC7)+SUM(SPEC8)+SUM(SPEC9)+SUM(SPEC10) AS COL12
FROM (
SELECT '전체' AS GUBUN,
CASE WHEN NVL(SPEC1, 0) != 0 THEN 1 ELSE 0 END AS SPEC1,
CASE WHEN NVL(SPEC2, 0) != 0 THEN 1 ELSE 0 END AS SPEC2,
CASE WHEN NVL(SPEC3, 0) != 0 THEN 1 ELSE 0 END AS SPEC3,
CASE WHEN NVL(SPEC4, 0) != 0 THEN 1 ELSE 0 END AS SPEC4,
CASE WHEN NVL(SPEC5, 0) != 0 THEN 1 ELSE 0 END AS SPEC5,
CASE WHEN NVL(SPEC6, 0) != 0 THEN 1 ELSE 0 END AS SPEC6,
CASE WHEN NVL(SPEC7, 0) != 0 THEN 1 ELSE 0 END AS SPEC7,
CASE WHEN NVL(SPEC8, 0) != 0 THEN 1 ELSE 0 END AS SPEC8,
CASE WHEN NVL(SPEC9, 0) != 0 THEN 1 ELSE 0 END AS SPEC9,
CASE WHEN NVL(SPEC10, 0) != 0 THEN 1 ELSE 0 END AS SPEC10,
대략 이런식으로 진행되는 쿼리입니다.