SELECT
ifnull(if(length(trim(字段))>0,字段,null),'1') num
FROM `tableName`
WHERE 1 = 1
and `id` = 'id'
mysql ifnull 判断空字符
最新推荐文章于 2023-04-20 16:13:39 发布
SELECT
ifnull(if(length(trim(字段))>0,字段,null),'1') num
FROM `tableName`
WHERE 1 = 1
and `id` = 'id'