더운데 오늘 컴터 앞에서 시름하시는 고수님들. 제 고민좀 풀어 주세염..
이틀째 고민중입니다..
firebird 쓰고 있구여
select count(*) as code ,sc_code from sukang_table
where sd_code='007' and jw_gubun='Y'
group by sc_code
union all
select count(*) as scode ,sc_code from sukang_table
where sd_code='007' and jw_gubun='N'
group by sc_code
이 sql 문을 firebird 용으로 수정 해보았습니다.
select sc_code, sum(case when jw_gubun='Y' then 1 else 0 end) as YCount,
sum(case when jw_gubun='N' then 1 else 0 end) as NCount
from sukang_table
where sd_code='007'
group by sc_code
이렇게 하면 로컬에서만 실행되고 리모트에서는 when 문장에서 에러 난다고 나오고 있습니다.
어떻게 해야 하는지 답변좀 꼭좀 부탁드릴께염.
그럼 오늘도 좋은 하루되세요
|