날짜 계산관련 문의드립니다.

by 치푸 posted Jul 29, 2009
select case
            when to_number(to_char(sysdate, 'd')) between 4 and 7 then sysdate + (10 - to_number(to_char(sysdate, 'd')))
            else sysdate +(3-to_number(to_char(sysdate, 'd'))) end
from db_root


화요일이 지났으면 다음 주 화요일을 조회하고, 화요일이 지나지 않았으면 이번 주 화요일을 출력하는 쿼리입니다.
쿼리에는 이상이 없는 것 같은데, "Semantic: '+' operator is not defined on types date and numeric. " 이라는 오류를 발생시키네요.
오라클에서는 이상이 없이 조회가 되는데요.
오라클 만의 특별한 명령어를 쓴 것도 아닌데...
무엇이 문제일까요?

Articles

9 10 11 12 13 14 15 16 17 18