工作小总结

【已解决】在使用mybatis的时候,怎么一次删除多个表

在我们工作的时候,有时候,会遇到这种情况,比如删除数据的时候,既要删除数据本身,也要删除数据对应log日志表中的数据,那么,使用mybatis怎么在一个deleteid中删除多个呢?如下图:如果直接按照上面这样写,可能会出现问题。###Errorupdatingdatabase. Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxError

在我们工作的时候,有时候,会遇到这种情况,比如删除数据的时候,既要删除数据本身,也要删除数据对应log日志表中的数据,那么,使用mybatis怎么在一个delete id中删除多个呢?

如下图:

ee202fef82dd5932ac546817390ebd00.png

如果直接按照上面这样写,可能会出现问题。


### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'delete from tbl_article where id = 12

原创不易,完成人机校验,阅读全文

相关推荐