我在这里找不到任何东西或google对我有用。
我试过以下代码:
delete from wms where barcode = '65025351102908' and '105077351106577';
值是一个varchar熊。
没有错误,但0行受到影响。但他们肯定在那里。
您的WHERE
条款没有按预期工作。你不能这样分解条件
写这个只会删除qazxsw poi:
65025351102908
我想你要删除WHERE barcode = '65025351102908' and '105077351106577';
-- ^------------------------^ ^---------------^
-- Condition 1 Condition 2 (always true because different than a falsy value)
和65025351102908
这是使用OR完成的(删除id等于第一个或第二个)
试试这个:
105077351106577
如果要删除大量裸代码,可以使用delete from wms where barcode = '65025351102908' or barcode = '105077351106577';
运算符:
IN
您是否尝试使用这两个值删除这两行?
然后这样做:
delete from wms where barcode IN ('65025351102908', '105077351106577');
你也可以这样做:
delete from wms
where (barcode = '65025351102908') or (barcode = '105077351106577');
如果你想删除那些值之间的“之间”(考虑到你将它们作为字符串写在单引号中),你的语法可能会更好:
delete from wms
where barcode in ('65025351102908','105077351106577');