SQL 获取Access中特定列为空的所有记录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5170865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting All Records where Particular Column is empty in Access
提问by itsaboutcode
I am writing a query in Access where I have to get all the records where a particular column is empty, how I can do this?
我正在 Access 中编写一个查询,我必须在其中获取特定列为空的所有记录,我该怎么做?
This is what I am thinking it should be, but its not working.
这是我认为应该是的,但它不起作用。
SELECT *
FROM TABLE
WHERE PARTICULARCOLUMN = ''
回答by Joe Stefanelli
This would handle both empty strings ('') and NULL values in the column.
这将处理列中的空字符串 ('') 和 NULL 值。
SELECT *
FROM TABLE
WHERE Nz(PARTICULARFIELD,'') = ''
回答by John K.
Try...
尝试...
WHERE PARTICULARFIELD Is Null
Sample from Web:
来自网络的示例:
SELECT [Table1].[CustomerID], [Table2].[CustomerID]
FROM [Table1] LEFT JOIN [Table2] ON [Table1].[CustomerID] = [Table2].[CustomerID]
WHERE ((([Table 2].[CustomerID]) Is Null));