AND peeid not in foreach collection=ids item=item open= close= separator= #item jdbcType=VARCHAR foreach not in 怎么改成 not exits
要将"AND pee.id not in"改为"AND NOT EXISTS",可以使用子查询来实现。以下是修改后的SQL语句:
AND NOT EXISTS (
SELECT 1
FROM your_table_name AS pee2
WHERE pee2.id IN (
<foreach collection="ids" item="item" open="(" close=")" separator=",">
#{item, jdbcType=VARCHAR}
</foreach>
)
)
原文地址: https://www.cveoy.top/t/topic/icGT 著作权归作者所有。请勿转载和采集!