반응형 스칼라1 GROUP BY 절에 DECODE로 된걸 SELECT 절에서 스칼라로 써 먹을 순 없나? group by 에 decode로 들어 간걸 select 절에서 스칼라 쿼리로 써 먹을 수 음나? 라는 문제에 봉착하게 됐다.. 말이 상당히 난해하다. 예제를 보도록 하자. WITH tb1 AS ( SELECT 'A' AS c1 , '1' AS c2 FROM DUAL UNION ALL SELECT 'A' AS c1 , '1' AS c2 FROM DUAL UNION ALL SELECT 'B' AS c1 , '1' AS c2 FROM DUAL UNION ALL SELECT 'C' AS c1 , '1' AS c2 FROM DUAL ), tb2 AS ( SELECT 'A' AS c1 , '곰' AS c2 FROM DUAL UNION ALL SELECT 'B' AS c1 , '개' AS c2 FROM DUAL U.. 2010. 4. 29. 이전 1 다음 반응형