BEGIN
CASE x
WHEN 0 THEN (
IF thisIsAVariable = 'viewAll' THEN
SELECT id, fname FROM Persons WHERE 1
ELSE
SELECT id, fname FROM Persons WHERE id = '1111'
END IF
);
END CASE;
END
What is the correct syntax for ifelse statments inside casewhen statements?
we can use if inside the if to make code easy like below: