文章详情页
mysql - msyql 判断字段不为空 简单方法
浏览:75日期:2022-06-16 18:33:35
问题描述
一般判断是否空where name is not null and name != ’’;
有没有简单方法 一步到位
length(name)>0 是个方法;有没有empty等?
问题解答
回答1:name != null;是错误的,因为null都不等于null
mysql> select null=null;null=nullNULL1 row in set (0.03 sec)
mysql> select null is null;null is null11 row in set (0.00 sec)
判断不为空,如果字段default null where name is not null 否则 where name != ’’
相关文章:
1. 主从备份 - 跪求mysql 高可用主从方案2. python - django 里自定义的 login 方法,如何使用 login_required()3. python如何不改动文件的情况下修改文件的 修改日期4. mysql主从 - 请教下mysql 主动-被动模式的双主配置 和 主从配置在应用上有什么区别?5. angular.js - 不适用其他构建工具,怎么搭建angular1项目6. android-studio - Android 动态壁纸LayoutParams问题7. mysql优化 - mysql count(id)查询速度如何优化?8. javascript - git clone 下来的项目 想在本地运行 npm run install 报错9. sql语句如何按or排序取出记录10. node.js - 使用 superagent 抓取 UTF-8网站乱码
排行榜
