我这里有以下代码:
SELECT productcode, Brand, product, size
from outerbarcodes i
where productcode = '' or productcode is null or
brand = '' or brand is null or
product = '' or product is null or
size = '' or size is null;
我想添加一个条件,以不包括在列产品代码内以 'PK'
开头的值。代码如何修改?
提前致谢
最佳答案
您可以将 LIKE
条件添加到当前的 where 子句中:
SELECT productcode, Brand, product, size
FROM outerbarcodes i
WHERE
(productcode > '' AND productcode NOT LIKE 'PK%') OR
brand > '' OR
product > '' OR
size > '';
关于mysql - SQL 选择一个语句期望值以以下开头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54982078/