Answers for "decode oracle query"

SQL
1

ORACLE SQL DECODE

SELECT 
DECODE (t.column_name,  1, 'Southlake', 
                        2, 'San Francisco', 
                        3, 'New Jersey', 
                        4, 'Seattle',
                           'Non domestic') new_name
FROM table_name t
 # If warehouse_id is not 1, 2, 3, or 4, then the function returns 'Non domestic'.
Posted by: Guest on September-11-2021
0

oracle decode

DECODE(X, D1, R1, D2, R2, D3, R3, ..., Rx)
/*
if X = D1 then return R1
else if X = D2 then return R2
else if X = D3 then return R3
...
else return Rx
*/
Posted by: Guest on February-02-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language