bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your

bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 5’ at line 8

错误:

<select id="selectByExampleWithDept" resultMap="WithDeptResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="WithDept_Column_List" />
    from tbl_emp e
    left join tbl_dept d on e.d_id = d.dept_id;
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>

left join 哪一行不应该有分号(“;”)去掉就好了

你可能感兴趣的:(bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your)