1

我有几个数据库,我需要在一些值前面插入一个字符串值。我有以下代码:

UPDATE DB_AlarmTest SET DB_AlarmTest.Address = "DB40," & [Address]
WHERE DB_AlarmTest.Address 
NOT LIKE '%DB40%';

我不希望我的地址像这样出现:“DB40,DB40,DB40,2.0”如果我多次执行查询,所以我添加了“NOT LIKE '%DB40%'”部分

有人可以告诉我为什么这不起作用吗?

提前致谢!

4

1 回答 1

2

With the usual ANSI options in MS Access, the wildcard is *, not %, so:

UPDATE DB_AlarmTest 
SET DB_AlarmTest.Address = "DB40," & [Address]
WHERE DB_AlarmTest.Address Not Like "*DB40*"
于 2013-02-14T09:52:52.723 回答