ifnull(field,0):如果field为null,则值为0; 先看下SELECT * FROM mytest.orders; 使用ifnull() select id,product,ifnull(price,0) from orders; oracle中使用 nvl() 函数达到一样的功能,mysql中没有nvl()函数。 来源:https://blog.csdn.net/xldmx/article/details/102761260 标签 select函数 nvl函数 nvl mysql mysql函数