Cannot getting empty result in case
I cannot get empty result in case and it returns NULL result:
SELECT CASE WHEN ('test' IS NULL) THEN (SELECT 'null_result') ELSE (SELECT 'empty_result' WHERE 1<>1) END;
0
I cannot get empty result in case and it returns NULL result:
SELECT CASE WHEN ('test' IS NULL) THEN (SELECT 'null_result') ELSE (SELECT 'empty_result' WHERE 1<>1) END;
Comments
I found the answer:
https://stackoverflow.com/questions/56372462/how-to-get-empty-result-set-with-a-case-statement
The query gives correct results: