Using SELECT REPLACE for multiple values
626119Mar 23 2010 — edited Mar 23 2010I would need to replace following resulting values into new values in a select sentence
2 -> DEPT2
3 -> DEPT3
4 -> DEPT4
SELECT REPLACE(DEPT_ID, "2", "DEPT2") from USER.TABLE
This is a single row resulting SQL. so, if value 2 occurs as a result, replace it in the results with 'DEPT2'. If value 3 occurs as a result, replace it in the results with 'DEPT3' etc.
Can someone help me with the nested SQL?
Thanks!