oracle decode

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

showing results for - "oracle decode"
Valeria
19 Jan 2020
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'.
Augustine
30 Nov 2016
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*/