网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

mysql 数据库将将空值转换为实际值

时间:2024-10-25 20:38:53

1、问题:在一些行中包含空值,需要使用非空的值来代替

2、解决办法:1、使用COALESCE 函数来替换空值select coalesce(column,0)from t0

3、使用case 来替换空值select case when column is null then 0 else column endfrom t0

© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com