1. 程式人生 > >SQL遍歷刪除資料

SQL遍歷刪除資料

1、根據主鍵遍歷刪除資料

<delete id="deleteDemo" parameterType="Integer">
	DELETE FROM T_DEMO WHERE ID in
	<foreach item="ID" collection="array" open="(" separator="," close=")">
		#{ID}
	</foreach>
</delete>