其他分享
首页 > 其他分享> > Mybatis表名为关键词时出现的错误

Mybatis表名为关键词时出现的错误

作者:互联网

1.[42000][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 ''order' where order_id = 1' at line 3

笔者在学习mybatis时,将表明设置成order关键词,发现报了以上错误

 2.解决方法

use bjpower;
select
          order_id, order_no, sale_datetime, totalAmount, totalQuantity
        from `order`
        where order_id = 1;

将关键词用反顿号括起来即可! 

3.展示

 

 

标签:use,your,关键词,syntax,Mybatis,order,id,名为
来源: https://blog.csdn.net/DrLai/article/details/121469212