常用情况,以下是计算库存,如果库存或者锁定库存为空,则给默认值为0SELECT (IFNULL(t_inventory.pro_number,0)-IFNULL(t_inventory.locked_number,0)) AS content_number FROM t_inventory