Check out example codes for "sql join on wildcard". It will help you in understanding the concepts better.

Code Example 1

select *
from tableA a join
     tableB b
     on a.id like '%' + b.id + '%';

Code Example 2

select *
from tableA a
where exists (select 1 from tableB b where  a.id like '%' + b.id + '%');

Learn ReactJs, React Native from akashmittal.com