MybatisPlus对Mysql数据库关键字作为列名的处理--SQLSyntaxErrorException: You have an error in your SQL syntax;
说明:
- 在设计数据库时,使用mysql关键字作为列名(比如order用于排序),就会报错:java.sql.SQLSyntaxErrorException: 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 'ORDER,CREATE_TIME,MODIFY_TIME FROM xxx' at line 1

解决办法:
- 修改列名名称,不要用关键字作为列名;(推荐使用)
- 在查询的时候,使用引号(单引号、双引号、反引号)将其关键字的列名括起来,
- 使用mybatis写sql的话,就不存在问题,可以加引号解决;
- 使用mybatisplus的话,当查询所有列时,就需要将所有列列出来,因为对应含有关键字的列名需要做处理。

MybatisPlus对Mysql数据库关键字作为列名的处理--SQLSyntaxErrorException: You have an error in your SQL syntax;的更多相关文章
- 报错的大怨种来了--java.sql.SQLSyntaxErrorException: 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 '' at line 1
频繁爆出这样的错误:java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual t ...
- 若依代码生成的一个大坑 You have an error in your SQL syntax; check the manual that corresponds to your MySQL s
报错如下所示:显示我的xml文件的SQL语句有错 ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: You h ...
- 插入数据库失败([Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version)
报错信息如下: , ) 原因,read是数据库的关键字, 牢记,如果一个词是数据库的关键字,那么在写数据库语句的时候,这个词一定是蓝色的(关键字颜色)!!
- C# Mysql 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 ????
有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...
- SpringMVC:com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax;
今天用SpringMVC做修改添加操作,之前的操作都实现了添加修改,但始终报com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have ...
- MySql 建表出现的问题:[ERR] 1064 - You have an error in your SQL syntax; check the manual.......
使用 MySql 建表出现的问题 在使用 Navicat Premium 运行 sql 语句进行建表时,MySQL 报错如下: 建表语句: DROP DATABASE IF EXISTS javawe ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;问题的解决
哇,时隔两天时间,终于找到这个问题的解决办法,先看问题 这是我最近写的家庭记账本网页版,按顺序输入点击保存,总是弹出添加失败的提示 顺着找原因,把原因锁定在dao层的sql语句上,反复检查,没有找到一 ...
- 解决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 'order (order_name, customer)
在学习hibernate一对多映射关系时,根据视频学习的时候,例子是顾客和订单的问题,一个顾客有多个订单.按照视频中的敲代码出现了You have an error in your SQL synta ...
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-- ::, WARN [org.hibernate.util.JDBCExceptionReporter:] - SQL Error: , SQLState: -- ::, ERROR [org.h ...
- [Err] 1064 - 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 ''<h1 style="text-align: center;">php
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...
随机推荐
- xTestRunner
高颜值测试报告-xTestRunner pip install XTestRunner # test_unit.py import unittest from XTestRunner import H ...
- 敏捷编辑器Sublime text 4中文配置Python3开发运行代码环境
敏捷编辑器Sublime text 4中文配置Python3开发运行代码环境 首先来到Win11环境下,进入Sublime text 4官网的下载页面:https://www.sublimetext. ...
- Python pickle 二进制序列化和反序列化 - 数据持久化
模块 pickle 实现了对一个 Python 对象结构的二进制序列化和反序列化. "pickling" 是将 Python 对象及其所拥有的层次结构转化为一个字节流的过程,而 & ...
- LVS Nginx HAProxy区别
LVS 抗负载能力强,性能高,能达到F5硬件的60%,对内存和cpu资源消耗比较低 工作在四层仅作分发之用,通过vrrp协议转发,具体流量由linux内核处理,没有流量的产生 稳定性.可靠性好,自身有 ...
- PS CJ37/CJ38 增加和返回预算
一.预算补充CJ37/预算返回CJ38 二.补充预算CJ37,点击保存 预算返回CJ38,点击保存 三.代码示例 预算补充代码 "------------------------------ ...
- SpringCloud学习 系列七、EurekaServer集群创建
系列导航 SpringCloud学习 系列一. 前言-为什么要学习微服务 SpringCloud学习 系列二. 简介 SpringCloud学习 系列三. 创建一个没有使用springCloud的服务 ...
- 封装http并挂载到全局
https://www.bilibili.com/video/BV1BJ411W7pX?p=32 具体使用:https://blog.csdn.net/weixin_44763569/article/ ...
- 写了个移动端可滑动(惯性滑动&回弹)Vue导航栏组件 ly-tab
https://www.imooc.com/article/23768?block_id=tuijian_wz https://blog.csdn.net/weixin_44614772/articl ...
- Vue 大屏可视化 铺满全屏
https://blog.csdn.net/u011097323/article/details/106728221?utm_medium=distribute.pc_aggpage_search_r ...
- md文件的基本常用编写语法
md简介 .md即markdown文件的基本常用编写语法,是一种快速标记.快速排版语言,现在很多前段项目中的说明文件readme等都是用.md文件编写的,而且很多企业也在在鼓励使用这种编辑方式.下面就 ...