mysql batch query [Reserved]

When general batch query keywords are in, but when a large amount of data, inefficient.

This time we can consider the use of union.

xml core code

<select id="selectList" resultMap="BaseResultMap" parameterType="java.util.List" >
<foreach collection="list" item="item" index="index" separator="UNION" >
(select 
from table
where 
id = #{item} )
</foreach>

</select>

 

Reproduced in: https: //www.cnblogs.com/memoa/p/10413746.html

Guess you like

Origin www.cnblogs.com/aaron95/p/11347459.html