mysql查询字段是否为空
yang
2020-05-12 14:22:543040浏览 · 0收藏 · 0评论
mysql查询字段是否为空的方法:
1、不为空
Select * From table_name Where id<>'' Select * From table_name Where id!=''
2、为空
Select * From table_name Where id='' Select * From table_name Where ISNULL(id)
具体情况具体分析,如果字段是char和varchar型用 id=''可以;如果是int型用 ISNULL好些
推荐:MySQL教程
关注公众号,随时随地在线学习