"<script> DELETE FROM xxx WHERE user_id=(SELECT user_id FROM yyy WHERE user_name=#{mobile}) AND product_id IN <foreach "
+ "collection='deleteIds'"
+ " index='index'"
+ " item='item' "
+ "open='(' separator=',' close=')'>"
+ " #{item}"
+ "</foreach>"
+ "</script>"
报这个错误
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 1
+ "collection='deleteIds'"
+ " index='index'"
+ " item='item' "
+ "open='(' separator=',' close=')'>"
+ " #{item}"
+ "</foreach>"
+ "</script>"
报这个错误
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 1
+ "collection='deleteIds'"
+ " index='index'"
+ " item='item' "
+ "open='(' separator=',' close=')'>"
+ " #{item}"
+ "</foreach>"
这段代码 返回的结果不止一条数据 。应该将WHERE user_id= 改为WHERE user_id in