select count(*) from edm_item where item='PMAGM-AT.522' group by item
다음과같은 쿼리가 있는데요.. 0건일경우 0으로 처리를 하고싶은데 no rows returned. 됩니다.
이렇게 처리하긴 했는데 마음에 들진 않네요...
SELECT
MAX(counts)
FROM
(
select count(*)counts from edm_item where item='PMAGM-AT.522' group by item
UNION
SELECT 0 counts from dual
)c
어떻게하는게 가장 깔끔한 방법일까요?