I am trying to do some case statement in my SQL. Below example shows what I want to do.
Example
case WHEN p = 1 THEN 'SOMETHING'
WHEN p = 1 AND q = 1 THEN 'SOMETHING ELSE'
Here, CASE returns the result of the first WHEN clause that evaluates to true. In this example , the first and second WHEN conditions are true, but returns the result of the first one.