2
UPDATE Table
    SET Table.[Field] = 'DUMMY' WHERE Table.[Acct Numb] not like 
( '*01'. '*03'. '*04'. '*07'. '*08'. '*09');

我可以在更新查询中使用 NOT LIKE 运算符吗?我正在使用 MS ACCESS 执行此查询。

谢谢

4

2 回答 2

3

您可以使用not like,但不能使用列表:

UPDATE Table
    SET Table.[Field] = 'DUMMY'
    WHERE Table.[Acct Numb] not like '*01' and
          Table.[Acct Numb] not like '*03' and
          Table.[Acct Numb] not like '*04' and
          Table.[Acct Numb] not like '*07' and
          Table.[Acct Numb] not like '*08' and
          Table.[Acct Numb] not like '*09';

你也可以这样写:

update table
     SET Table.[Field] = 'DUMMY'
     where right(Table.[Acct Numb], 2) not in ( '01'. '03'. '04'. '07'. '08'. '09')
于 2013-07-01T14:42:12.487 回答
1

基于访问的 MS 参考,正如@Alex K 所建议的那样

http://office.microsoft.com/en-sg/access-help/access-wildcard-character-reference-HP005188185.aspx

你应该能够做到:

UPDATE Table
    SET Table.[Field] = 'DUMMY'
    WHERE Table.[Acct Numb] not like '*0[134789]'
于 2013-07-01T14:48:37.387 回答