oracle sql decode

Solutions on MaxInterview for oracle sql decode by the best coders in the world

showing results for - "oracle sql decode"
Fabio
09 Mar 2017
1SELECT 
2DECODE (t.column_name,  1, 'Southlake', 
3                        2, 'San Francisco', 
4                        3, 'New Jersey', 
5                        4, 'Seattle',
6                           'Non domestic') new_name
7FROM table_name t
8 # If warehouse_id is not 1, 2, 3, or 4, then the function returns 'Non domestic'.
Rahma
10 Apr 2019
1DECODE(X, D1, R1, D2, R2, D3, R3, ..., Rx)
2/*
3if X = D1 then return R1
4else if X = D2 then return R2
5else if X = D3 then return R3
6...
7else return Rx
8*/