如何更新 MySQL 数据库中的两列?

2022-01-17 00:00:00 sql-update mysql

这不起作用:

UPDATE customers SET firstname="John" AND lastname="Smith" WHERE id=1;

推荐答案

用逗号分隔值.AND 是一个逻辑运算符,它的位置在 WHEREON 子句中.

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;

相关文章