set 0 or string if the return rows is empty in mysql code example Example: check if value is null mysql SELECT * from TABLE where CODE IS NULL OR CODE!='C'