SQL Únete a comodín
select *
from tableA a join
tableB b
on a.id like '%' + b.id + '%';
Combative Cat
select *
from tableA a join
tableB b
on a.id like '%' + b.id + '%';