如何解决Hibernate和MYSQL:您的SQL语法有错误吗?
我的Java代码中有以下查询:
String queryString = "select \r\n" +
"cms.status_id as 'statusId',\r\n" +
"cms.status_label as 'statusLabel',\r\n" +
"csl.status as 'status',\r\n" +
"from "+client+".my_status cms \r\n" +
"join "+client+".status_list csl on csl.status = cms.status_id\r\n";
运行代码时,出现以下错误:
SQL Error: 1064,SQLState: 42000
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
可能是什么原因造成的?我看不到查询问题,因此可以手动使其正常工作。
解决方法
此行中还有一个逗号:
"csl.status as 'status',\r\n" +
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。