a表存在而b表不存在的关联数据

用for循环效率太低,采用以下sql

<select id="selectNotin" resultType="com.gaiaworks.pjo.entity.CdAdmin">
        select * from cd_admin a  where a.type=2 and(select count(1) FROM Cust_dept5th c where c.cust_headOfUnit =a.operate_num)=0
    </select>

 

posted @ 2022-07-07 09:42  820820820  阅读(44)  评论(0)    收藏  举报