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
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 |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.