MySql中判断null

MySql中判断null,第1张

MySql中判断null可以用 is null 和 <=>

1、is null :仅仅可以判断null值,可读性较高,建议使用。

select * from base_user where username is null

2、<=>    :既可以判断null值,也可以判断普通的数值,可读性较低。

select * from base_user where username <=>null

删除还是替换

删除

delete from table where column is null

替换

update table

set column=''

where column is null


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7577040.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-07
下一篇 2023-04-07

发表评论

登录后才能评论

评论列表(0条)

保存