mysql推断字段可否为空
发布时间:08/01 来源:未知 浏览:
关键词:
isnull()
select * from users where email = 'xxxx' and isnull(deletedAt)
is null
select * from users where email = 'xxxx' and deletedAt is null
is not null
select * 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推断字段可否为空的细致内容,更多请关注 百分百源码网 其它相干文章!