当前位置:网站首页>MYSQL 用!=查询不出等于null的数据,解决办法
MYSQL 用!=查询不出等于null的数据,解决办法
2022-07-04 20:33:00 【monody666】
例如,某个字段有null、“0”、“1”三种,因为默认值为null,有时需要查询null或者0的数据。如果直接用 xxx != “1”,只能查询出“0”的。所有需要用别的写法。
1.xxx IS NULL OR xxx != "1"
2.NOT(xxx <=> "1")
因为 = 不能比较null,<=>可以.(<>相当于!=,起不到<=>这种包含null比较的效果)
边栏推荐
- go defer的使用说明
- In the release version, the random white screen does not display the content after opening the shutter
- colResizable.js自动调整表格宽度插件
- torch. Tensor and torch The difference between tensor
- FastDfs的快速入门,三分钟带你上传下载文件到云服务器
- 杰理之AD 系列 MIDI 功能说明【篇】
- 学习突围3 - 关于精力
- numpy vstack 和 column_stack
- HWiNFO硬件检测工具v7.26绿色版
- 福昕PDF编辑器v10.1.8绿色版
猜你喜欢

多模輸入事件分發機制詳解

网件r7000梅林系统虚拟内存创建失败,提示USB磁盘读写速度不满足要求解决办法,有需要创建虚拟内存吗??

华为ensp模拟器 给路由器配置DHCP

WGCNA analysis basic tutorial summary

IIC (STM32)

Redis:Redis配置文件相关配置、Redis的持久化

Word文档中标题前面的黑点如何去掉
![[1200. Minimum absolute difference]](/img/fa/4ffbedd8f24c75a20d3eaeaf0430ae.png)
[1200. Minimum absolute difference]

Huawei ENSP simulator enables devices of multiple routers to access each other

每日一题-LeetCode1200-最小绝对差-数组-排序
随机推荐
【1200. 最小绝对差】
Pytorch---使用Pytorch实现LinkNet进行语义分割
杰理之AD 系列 MIDI 功能说明【篇】
HMS Core 统一扫码服务
Nmap scan
Jerry's ad series MIDI function description [chapter]
Redis cache
Kubeadm初始化报错:[ERROR CRI]: container runtime is not running
每日一题-LeetCode556-下一个更大元素III-字符串-双指针-next_permutation
多模輸入事件分發機制詳解
Huawei simulator ENSP common commands
Gobang go to work fishing tools can be LAN / man-machine
基于OpenCV haarcascades的对象检测
Maidong Internet won the bid of Beijing life insurance
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
[Shenbo introduction] VI How to contact your favorite doctoral tutor
Render function and virtual DOM
Day24: file system
Jerry's ad series MIDI function description [chapter]
[micro service SCG] use of predict