My MyBatis XML looksl like this
<code><delete id="deleteAllById" parameterType="java.util.List">
DELETE FROM `user`
WHERE id IN
<foreach collection="list" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</code>
<code><delete id="deleteAllById" parameterType="java.util.List">
DELETE FROM `user`
WHERE id IN
<foreach collection="list" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</code>
<delete id="deleteAllById" parameterType="java.util.List">
DELETE FROM `user`
WHERE id IN
<foreach collection="list" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
And the error is
Error updating database. 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 ” at line 2 ### The error may exist in io/analog/cyclingservice/mapper/UserMapper.xml ### The error may involve io.analog.cyclingservice.mapper.UserMapper.deleteAllById-Inline ### The error occurred while setting parameters ### SQL: DELETE FROM user
WHERE id IN ### 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 ” at line 2 ; bad SQL grammar []
Any help on the correct syntax is appreciated.
I tried removing “ ” but same error.