对于这样的事情正确的查询是什么:
UPDATE table SET field1 WHERE field2 = val and field3 = val AND val AND val;
其中field3有多个值。非常感谢,希望您理解:)
最佳答案
The SQL IN condition (sometimes called the IN operator) allows you to easily test if an expression matches any value in a list of values. It is used to help reduce the need for multiple OR conditions in a SELECT, INSERT, UPDATE, or DELETE statement.
UPDATE table SET field1=newVal WHERE field2 = val and field3 In (val1, val2, val3);
关于mysql - WHERE 中的表字段有多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45776135/