1、用minus函数的方式:
select
*
from
CMN_FUND
where
FUND_CODE_ in
(select FUND_CODE_ from CMN_FUND minus select FUND_CODE_ from CMN_PROMOTION_FUND where FUND_CODE_ in
(select FUND_CODE_ from CMN_PROMOTION_FUND where SELLPROMOTE_CODE_ = #{promotionCode}))
and
FUNDCOMP_CODE_ = #{fundCompCode}
order by
FUND_CODE_
2、用not in来处理:
select
f.FUND_CODE_, f.SHORT_NAME
from
CMN_FUND f, CMN_PROMOTION_FUND p
where
f.FUND_CODE_ = p.FUND_CODE_
and
f.FUND_CODE_ not in (SELECT FUND_CODE_ from CMN_PROMOTION_FUND where PROMOTION_CODE = #{promotionCode})
and
f.FUNDCOMPCODE = #{fundCompCode}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)