Input Data:
columnA columnB
true false
true true
false false
false true
Problem Statement: From above mentioned data, I want to use different columns to get the result.
Expected Output:
columnA columnB result
true false A
true true B
false false C
false true C
Tried SQL Query:
SELECT
columnA,
columnB,
CASE columnA WHEN 'true' AND columnB ='false' THEN 'A'
WHEN 'true' AND columnB ='true' THEN 'B'
ELSE 'C' END AS result
It seems unable to use different columns in CASE expression. Is there any solution?
