+ 3
How to use DECODE function in SQL ?
Its used for conditional processing, please provide some example.
1 Answer
+ 5
SELECT manufact_name, DECODE (manufact_id, 1000, 'BMW', 1001, 'AUDI', 1002, 'CHEVROLET') result from manufaturers; will return BMW if manufat_id is 1000 and CHEVROLET if manufact_id is 1002. This can be used to avoid if - elsif ladder