The following query:
SELECT DECODE(country_id, 1, 'United States',
2, 'England',
NULL, 'France')
FROM customers;
returns:
- 'United States' if the country_id is 1
- 'England' if the country_id is 2
- NULL if the country_id is NULL
- NULL if the country_id is not equal to 1, 2, or NULL