mysql数据库字段为空的判断_mysql怎么判断字段为空

mysql怎么判断字段为空

发布时间:2020-06-08 17:17:02

来源:PHP中文网

阅读:186

作者:三月

下文给大家带来有关mysql怎么判断字段为空内容,相信大家一定看过类似的文章。我们给大家带来的有何不同呢?一起来看看正文部分吧,相信看完mysql怎么判断字段为空你一定会有所收获。

这里提供了5种方法进行查询:

isnull()select * from users where email = 'xxxx' and isnull(deletedAt)

is nullselect * from users where email = 'xxxx' and deletedAt is null

is not nullselect * from users where email = 'xxxx' and deletedAt is not null

!isnull()select * from users where email = 'xxxx' and !isnull(deletedAt)

select * from users where email = 'xxxx' and not isnull(deletedAt)

isfull

当查询条件为 null,用指定字符替代select name, isfull(gender,'未知') as gender from users where email = 'xxxx'

对于上文关于mysql怎么判断字段为空,大家觉得是自己想要的吗?如果想要了解更多相关,可以继续关注我们的行业资讯板块。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值