MyBatis 中将 AND pee.id not in 改成 not exists 的方法
要将"AND pee.id not in"改成"not exists",并且没有"in"和"not in",可以使用子查询来实现。以下是修改后的SQL语句示例:\n\n\nAND NOT EXISTS (\n SELECT 1\n FROM your_table_name AS pee\n WHERE pee.id = your_table_name.id\n AND pee.id = #{item, jdbcType=VARCHAR}\n)\n\n\n这样就使用了"not exists"来替代"not in",并且没有使用"in"和"not in"子句。请将"your_table_name"替换为你的实际表名。
原文地址: https://www.cveoy.top/t/topic/pVnv 著作权归作者所有。请勿转载和采集!