开发者

mysql null to 0

开发者 https://www.devze.com 2022-12-15 14:25 出处:网络
SELECT * from book; how to convert NULL result t开发者_运维知识库o 0 from the sql ?You\'re looking for the COALESCE keyword:
SELECT * from book;

how to convert NULL result t开发者_运维知识库o 0 from the sql ?


You're looking for the COALESCE keyword:

SELECT COALESCE(fieldName, 0) FROM book


SELECT IFNULL(pages, 0) FROM book;

if pages was the name of your column.

0

精彩评论

暂无评论...
验证码 换一张
取 消