xxxxxxxxxx
SELECT IF(guides.colName IS NULL, 'Yes','No') FROM tableName;
-- Or
SELECT
CASE
WHEN colName IS NULL THEN 'Yes'
ELSE 'No'
END
FROM tableName;
xxxxxxxxxx
-- HOW TO COVER BOTH CASES IF NULL OR IF EMPTY ?
-- nullif does the trick: is returning NULL if field is an empty string
-- NULLIF() returns NULL if two expressions are equal, otherwise it returns the first expression
SELECT coalesce(nullif(field1,''),nullif(field2,'')) AS field1
FROM tablename;