on 2023 Aug 10 4:11 AM
hello teams
Could you give me some examples of how to use the "CASE" statement within a query in the analysis and reporting module, since when using the one that sql throws me an error.
EXAMPLE
SELECT
SC.priority
CASE
WHEN SC.priority = 'HIGH' THEN 'Alta'
WHEN SC.priority = 'MEDIUM' THEN 'Media'
ELSE 'Baja'
END AS PRIORITY_TRASLATE
FROM
ServiceCall SC
ERRORCA-113: Query syntax error at position [4] for [SELECT SC.priority CASE WHEN SC.priority = 'HIGH' THEN 'Alta' WHEN SC.priority = 'MEDIUM' THEN 'Media' ELSE 'Baja' END AS prioridad FROM ServiceCall SC LIMIT 1000]. See: [CASE].
Dear rubesala1983,
Can you please try the following:
SELECT
SC.priority,
CASE
WHEN SC.priority = 'HIGH' THEN 'Alta'
WHEN SC.priority = 'MEDIUM' THEN 'Media'
ELSE 'Baja'
END AS PRIORITY_TRASLATE
FROM
ServiceCall SC
LIMIT 1000;
--
Regards,
H.V.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kindly use the query as it is to make sure it is properly structured.
User | Count |
---|---|
13 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.