简体   繁体   English

简单的陈述:我的 SQL 语法有什么错误

[英]easy statement:what's the error in my SQL syntax

I can't find the syntax error.我找不到语法错误。 The spirit table is as belows: spirit表如下: 在此处输入图像描述

mysql> UPDATE spirit SET defend = 20, hp = 110, interval = 4 WHERE spirit_ID = 4;
ERROR 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 'interval = 4 WHERE spirit_ID = 4' at line 1

I am so confused, thanks for your help.我很困惑,谢谢你的帮助。

You can try wrapping interval with backticks( `` ):您可以尝试使用反引号( `` )来包装interval

UPDATE spirit SET defend = 20, hp = 110, `interval` = 4 WHERE spirit_ID = 4;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM