mysql条件加=null
时间: 2023-12-01 19:46:45 浏览: 100
MySQLNULL值简介
在MySQL中,要查询某个字段是否为NULL,可以使用IS NULL或IS NOT NULL操作符。如果要查询Address字段为NULL的记录,可以使用以下语句:
SELECT LastName, FirstName, Address FROM Persons WHERE Address IS NULL
如果要查询Address字段不为NULL的记录,可以使用以下语句:
SELECT LastName, FirstName, Address FROM Persons WHERE Address IS NOT NULL
这样就可以根据需要选择带有NULL值或不带有NULL值的记录了。\[2\] \[3\]
#### 引用[.reference_title]
- *1* *2* [MySQL NULL 值](https://blog.csdn.net/SSY_1992/article/details/130242306)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [MySQL where条件is null 及is not null 的用法](https://blog.csdn.net/zzx262625/article/details/129295457)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文