Mysql批量操作2(批量删除)

前一篇写了批量查询,本篇主要写批量删除语句。如果有不明白sql语句中的字段意思,建议通过前一篇批量查询进行了解。

直接上代码:

sql语句的写法:

    <select  id = "XXX(方法名)"  parameterType = "hashmap" >

             delete  from  table(table写自己的表名称)

             where

             id  in

             <foreach collection="idList"  item="item" index ="index" open="(" separator="," close=")">

                        #{item}

             </foreach>

    </select>


根据id批量删除数据


猜你喜欢

转载自blog.csdn.net/little_soybean/article/details/78660257