mysql - MYSQL, not valid at this position, expecting an identifier
问题描述
I am struggling my head around days to get rid of this error, but still in vain. I already search SO before posting the error, but none of them helped me. Snapshot
Here is my query
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE groups;
SET FOREIGN_KEY_CHECKS = 1;
I double checked the the table group exist
Edit: Just found out that groups
is a reserved keyword in MySQL, so is there anyway for me to truncate the table groups
解决方案
正如编辑中所写,这groups
是 MySQL 中的保留字,所以我不得不使用这样的语法
TRUNCATE `groups`
为了使它工作。
推荐阅读
- python - 检查 n 个连续元素是否等于 x 并且任何前一个元素是否大于 x
- postgresql - 如何在plpgsql中指定两个查询可以并行运行
- asp.net-mvc - 带有 Plesk 的 ASP.NET MVC
- logic - 如果给出了array(XOR)array[1:],则查找一个数组
- html - Sublime Text 3 中的悬停代码既不响应也不工作
- php - 手动移除额外的 Modx
- csv - 从 Ansible 写入 csv 文件中的特定单元格
- node.js - 我试图从 discord.js 中的文本文件中读取随机行,然后将其发布到命令 ;randomise 被询问的频道中
- reactjs - 使用 React 和 Django Rest 框架的多步表单处理
- python - 在黑客上对给出运行时错误的测试用例进行排名,但在本地机器中给出正确的输出