开发者社区 问答 正文

sql语句没有写错 在执行的时候idea报错了 在workbench里面也可以?报错

            " inner join user_dormitory as b on a.dor_id = b.dor_id"+<br>
            "inner join user as c on b.student_number = c.user_number"+<br>
            "where a.ridgepole = #{ridgepole} and a.unit = #{unit} and a.door_number = #{doorNumber} and b.room_number = #{roomNumber}"<br>
    )</p>

<pre><code>    报错:
    Cause: 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 'a.ridgepole = '10' and a.unit = 'A' and a.door_number = '532' and b.room_number ' at line 1
</code></pre>

<pre><code></code></pre>

展开
收起
爱吃鱼的程序员 2020-06-23 01:18:26 719 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    很明显你的sql都连在一起了啊,
    建议把+号后面的字符串都给带上空格

    2020-06-23 01:18:43
    赞同 展开评论