MySQL Alternative to MSSQL''s isNull()

I was looking for a way to do isNull() in MySQL the other day, for those that don’t know this means you can do something like:

1
SELECT isNull(mycolumn, 'blah') FROM myTable;

If the value in mycolumn is NULL, then ‘blah’ is returned, this can of course be any string literal/numeric value you want. MySQL doesn’t have isNull() but it does have ifNull() which is basically the same.

1
SELECT ifNull(mycolumn, 'blah') FROM myTable;

Comments