SELECT CASE x WHEN (x IS NULL) THEN 'null' ELSE 'nonnull' END FROM (SELECT null as x);