sql - How to Select where in(Other table) but with modification -


@conflisttable table valued parameter (tvp) has list of confirmation codes. want select records pmthist table confirmation code in @conflisttable. following code works this; no problems.

select * pmthist confirmation in(     select str1 confirmationcode     @conflisttable     ) 

my problem this: confirmation code in pmthist has "voided" following confirmation code. "ab321voided" want records too. how modify above query records match either record in @conflisttable or matches @conflisttable + 'voided'?

a quick & easy way use replace:

select *  pmthist replace(confirmation, 'voided', '') in(     select str1 confirmationcode     @conflisttable )