SELECT * from book;
how to convert NULL result to 0 from the sql ?
SELECT * from book;
how to convert NULL result to 0 from the sql ?
SELECT IFNULL(pages, 0) FROM book;
if pages
was the name of your column.
You're looking for the COALESCE keyword:
SELECT COALESCE(fieldName, 0) FROM book