I often run into the situation that I have quite complex operations that sometimes have to be processed further with a case.
It looks pretty ugly and has lots of redundant code in it if I use it the usual way.
case when (1+1) > 0 then (1+1) else null end
Although I usually prefer to do such work in a CTE or subquery, sometimes that makes the query even more complicated. Here is a "simpler" method:
select nullif(greatest(1 + 1, 0), 0) from dual;
greatest() will return 0 for 0 or
NULL values (equivalent to the condition in the
NULL for 0 or negative values.