I have such type of query:
SELECT table1.field1, table1.field2, table2.field3
FROM table1
LEFT JOIN table2 ON (...)
because of left join i sometimes have table2.field3 NULL
After that in my php script in cycle i redefine it manually
...
$row['field3'] = ($row['field3'] === null) ? 'undefined' : $row['field3'];
...
But how can i get this 'undefined' in my result-set?
I ve searched for answer, COALESCE seems to work, but it have some strange logic with many-many arguments. Seems like it do what i want, but somehow strange..
Im interested if there another simple way to replace my NULL with 'undefined'?
COALESCEin mysql