Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql当字段有特殊的字符串的时候,比如desc,修改或者增加数据,sql语句报错 #32

Closed
coverthesea opened this issue Apr 11, 2023 · 1 comment

Comments

@coverthesea
Copy link

当表字段是一些特殊的字符串的时候,比如desc,修改或者增加数据,会报错,需要加上引号

@LeoNumber1
Copy link

是的,我的一个表名叫partition,估计是mysql的保留字,在页面上查看的时候会报错:[SELECT COUNT(*) count FROM partition] -> 执行失败: 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 'partition' at line 1

比如说我的db名是test,查询的sql应该是 [SELECT COUNT(*) count FROM test.partition]

@may-fly may-fly closed this as completed Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants