文章目錄
- 例外描述:
- 錯誤原因+解決辦法:
例外描述:

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 ‘LIMIT 10’ at line 1
SQL: select * from department order by did asc; LIMIT 10
SQL查詢陳述句截圖:

錯誤原因+解決辦法:
我們知道分頁查詢使用 limit,而PageHelper插件的PageInterceptor攔截器就是對查詢的sql進行攔截然后后面拼接limit實作分頁,
進行拼接的時候,就需要我們的sql陳述句后面沒有結束符號;分號,將sql陳述句的;分號去掉就可以解決這個問題了,


轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/185967.html
標籤:其他
