如何使用数据库检索空值 [英] how to retrieve null value with database
本文介绍了如何使用数据库检索空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两列,一个是值,第二个是null,我想检索两列的数据,请使用where where help
解决方案
你可以试试SELECT * FROM myTable WHERE myTable.A = value OR myTable.B为null
另一种方法是
SELECT * FROM myTable WHERE myTable.A = value
UNION
SELECT * FROM myTable WHERE myTable.B为null
i have two columns one is having values and second one is null and i want to retrieve data for both columns using where condition please help
解决方案
You can trySELECT * FROM myTable WHERE myTable.A = value OR myTable.B is null
An alternate approach is
SELECT * FROM myTable WHERE myTable.A = value UNION SELECT * FROM myTable WHERE myTable.B is null
这篇关于如何使用数据库检索空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文