1. 程式人生 > 其它 >《演算法圖解》讀書筆記

《演算法圖解》讀書筆記

技術標籤:javamysql

mysql in 查詢優化,快沒快俺也不知道

<select id="listExistOrgCode" resultType="java.lang.String">
        select a.org_code from jf_vis_db.vms_video_orgrange a
        inner join (
            <foreach collection="allParentAndChildCodeSet" item="item" index="index" separator="UNION ALL" >
                select #{item} as org_code
            </foreach>
        ) tmp
        on a.org_code=tmp.org_code
        where a.videoplan_id=#{videoPlanId}
 </select>