Is there a way to do the following without a CASE
statement?
SELECT ifnotnull(field1, '!!!')
Now I'm currently doing the verbose:
CASE WHEN field1 IS NOT NULL THEN '!!!' ELSE field1 END
yes:
SELECT if(field1 is not null, '!!!', field1)
which would be the same as
SELECT if(field1 is not null, '!!!', NULL)
Documentation on IF
is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With