on ‎2023 Dec 21 10:02 AM
Dear experts
I have a couple of questions related to Hana SQL script :
01. Is there a smart way to replace multiple CASE WHEN IS NOT NULL THEN A ELSE B
see attachment01
02. Is there a smart way to replace multiple CASE WHEN A THEN B
WHEN C THEN D
WHEN L THEM M
see attachment 02
Thanks
Request clarification before answering.
Instead of using CASE and LIKE, you could use MAP and SUBSTR_REGEXPR like in below example
MAP(SUBSTR_REGEXPR('RED|YELLOW|GREEN' IN BULK_CHANGE_CONTROL_INDICATOR),
'RED',3,
'YELLOW',2,
'GREEN',1,
0) AS BULK_CHANGE_CONTROL_INDICATOR
IFNULL(SUQ_COUNTRIES,'N/A') AS SUQ_COUNTRIES
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.