Postgresql Mybatis当使用内部查询测试条件时
我正在寻找一个可以在Mybatis中使用内部查询返回值或直接SQL的查询Postgresql Mybatis当使用内部查询测试条件时,postgresql,mybatis,spring-mybatis,Postgresql,Mybatis,Spring Mybatis,我正在寻找一个可以在Mybatis中使用内部查询返回值或直接SQL的查询 <foreach item="ID" index="index" collection="selectionIds" separator=";"> UPDATE TABLE_1 SET ACT_IND ='N', upd_by = 1234 WHERE SLCT_ID = #{ID} AND rem=
<foreach item="ID"
index="index"
collection="selectionIds"
separator=";">
UPDATE TABLE_1 SET
ACT_IND ='N', upd_by = 1234
WHERE SLCT_ID = #{ID}
AND rem= select REM from TABLE_1 where SLCT_ID=#{ID}
<choose>
<when test="rem == 3">
AND Bbsid=#{nsid}
</when>
<otherwise>
AND asid=#{asid}
</otherwise>
</choose>
</foreach>
从上面的查询中,如何获取rem值并在when条件下使用
谢谢你说的perm值是什么意思?修改了我的帖子,它不是prem。你有没有试过从表1中选择rem作为子查询,其中SLCT_ID={ID},然后呢?它不起作用,因为它希望子查询作为输入参数。你把条件移动到分离sql片段并像这样包含它呢?