You can solve this with UNION:
select * from supp a inner join trd_acct b
on a.btch_id = 11170 AND a.btch_id = b.btch_id
UNION ALL
select * from supp a inner join trd_acct b
on a.btch_id = 11164 AND a.supp_id = b.supp_id
Or you can try CASE EXPRESSION:
select * from supp a
inner join trd_acct b
on CASE WHEN a.btch_id = 11164 THEN a.supp_id
WHEN a.btch_id = 11170 THEN a.btch_id END
= CASE WHEN a.btch_id = 11164 THEN b.supp_id
WHEN a.btch_id = 11170 then b.btch_id END
source
share