Trying to do a case statement with 2 values. I tried following SQL Case with 2 conditions example but unable to get it.
Logic trying to do:
where stack
is in nodeName
and overflow
is in scenarioName
, then replace nodeName
value Stack
with Usethisvalue
, within the nodeName
column.
My query:
SELECT endOfDay as businessDate,
(CASE nodeName,
WHEN nodeName = 'Stack' AND scenarioName = 'Overflow' THEN Usethisvalue
END) as nodeName,
scenarioName, Value
FROM CONTRIBUTION
Can anyone help with this?