This changes slightly depending on which database you are using, but it looks like you're looking for something like this:
MSSQL
select *
from table1 t1
join table2 t2 on t2.groupid like '%'+cast(t1.groupid as varchar(max))+'%'
MySQL - use Concat()
:
select *
from table1 t1
join table2 t2 on t2.groupid like concat('%',t1.groupid,'%')