MS Access不包括特定标准

时间:2014-10-17 16:31:45

标签: ms-access-2007

我试图过滤掉MS Access中尝试过的“Not”,“Not Like”和<>没有运气可以有人帮忙吗?

1 个答案:

答案 0 :(得分:0)

您可以使用<>如果你只排除一个数字,比如。

SELECT 
    yourFieldName1,
    yourFieldName2
FROM
    yourTableName
WHERE 
    yourNumberField <> 500;

如果您想要一系列数字,那么您可以使用,

SELECT 
    yourFieldName1,
    yourFieldName2
FROM
    yourTableName
WHERE 
    (
        (yourNumberField <> 1)
        Or
        (yourNumberField <> 2)
        Or
        (yourNumberField <> 3)
        Or
        (yourNumberField <> 4)
        Or
        (yourNumberField <> 500)
    );

我也会用,

SELECT 
    yourFieldName1,
    yourFieldName2
FROM
    yourTableName
WHERE 
    yourNumberField Not In (1, 2, 3, 4, 500);