Decode everything that is not defined as ‘internal’ or ‘Web’ to ‘external’ (oracle)

oracle

I'm trying to decode a columns with about 30 different possible values down to 3 values.

I want the decoded value to be "internal" if the original value is "Interal KS & others", or "Web" if the original field is "Webshop", all other values i want to decode as "external".

Is this possible? or do i have to define a really long decode definition. I know it is possible to use > or < for numbers but how do i do "everything else" for text values?

Best Answer

It think this is much better (cleaner) done using a CASE statement:

case 
  when the_column in ('Interal KS & others', 'Web') then 'internal'
  else 'external'
end