문제

I am using a Decode function something like this:

DECODE ((select country_id from XYZ), 
                    'IT', 'Italy',
                    'JP', 'Japan', 
                    'US', 'United States', country_id);

I want it to be behave in such a manner that If country_id is one of these three then it should decode the Id otherwise the default should display the country_id as it is.

Is this possible..??

도움이 되었습니까?

해결책

Just change order (Decode should be within select):

select Decode(country_id, 
              'IT', 'Italy',
              'JP', 'Japan', 
              'US', 'United States', 
              country_id)
  from XYZ
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top