Request processing failed: nested exception is org.springframework.jdbc.BadSqlGrammarException(后來仔細一看能看出來是sql語法錯誤)


錯誤提示:

Request processing failed: nested exception is org.springframework.jdbc.BadSqlGrammarException

Unknown column 'e.dept_id' in 'on clause'

解決方案:

在配置文件src/main/resources/mapper/EmployeeMapper.xml中找到查詢語句

FROM tbl_emp e
LEFT JOIN tbl_dept d ON d.`dept_id`=e.`d_id`

發現是其中的e和d寫反了,e表格中才有"d_id",d表格中才有"dept_id"。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM