错误原因是:实体类数据库的名称都为order 和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 order0_ limit 10’ at line 1
失败写法:select o.id as OrderId,o.createTime as OrderCreateTime,o.type as OrderType,o.cashAmount as OrderCashAmount,o.customer.id as OrderCustomerId from Order o
正确的写法:
select o.id as OrderId,o.createTime as OrderCreateTime,o.type as OrderType,o.cashAmount as OrderCashAmount,o.customer.id as OrderCustomerId from Orders o
在尝试执行SQL查询时,遇到了由于数据库实体名称与SQL关键字`order`冲突导致的错误。错误信息提示在SQL语法中存在错误,建议检查与MySQL服务器版本对应的使用手册以修正语法。解决方案是通过别名避免关键字冲突,例如将表名`Order`改为`Orders`,从而成功执行查询。
1457

被折叠的 条评论
为什么被折叠?



