此查询返回以下错误。有人知道吗???
@SqlQuery("SELECT * FROM employee WHERE id = (:id) ")
Employee getByid(@Bind("id") Integer id);
结果:
2018-08-29 11:12:19.532 ERROR 9736 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] :
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed;
nested exception is org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: Could not clean up
[statement:"SELECT * FROM employee WHERE id = (:id) ", located:"SELECT * FROM employee WHERE id = (:id) ",
rewritten:"SELECT * FROM employee WHERE id = (?) ", arguments:{ positional:{}, named:{id:1}, finder:[]}]] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
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 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1
1条答案
按热度按时间ifmq2ha21#
这是因为你的语法有问题。您的参数用括号()括起来。
试试这个: