如何更新 MySQL 数据库中的两列?
这不起作用:
UPDATE customers SET firstname="John" AND lastname="Smith" WHERE id=1;
推荐答案
用逗号分隔值.AND
是一个逻辑运算符,它的位置在 WHERE
和 ON
子句中.
Separate values with commas. AND
is an logical operator, its place is in WHERE
and ON
clauses.
UPDATE customers SET firstname="John", lastname="Smith" WHERE id=1;
相关文章