"分析SQL update student ( set score=100 , birthday='1995-12-15' where name='韦汉臣') and ( set heigth=160,score=60,birthday='2028-12-15' where name='无名');\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( set score=100 , birthday='1995-12-15' where name='韦汉臣') and ( set heigt' at line 1"\n这个SQL语句有语法错误,正确的写法应该是使用逗号分隔多个更新语句,而不是使用AND关键字:\n\nsql\nUPDATE student\nSET score = 100, birthday = '1995-12-15'\nWHERE name = '韦汉臣';\n\nUPDATE student\nSET height = 160, score = 60, birthday = '2028-12-15'\nWHERE name = '无名';\n\n\n这样分别更新了名字为'韦汉臣'和'无名'的学生的信息。

MySQL UPDATE 语法错误分析:使用逗号分隔多个更新语句

原文地址: https://www.cveoy.top/t/topic/qfqq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录