You only need to concatenate the strings, you could also do a search and replace.
SELECT
a.first_name,
b.age
FROM names a
JOIN ages b
ON b.full_name LIKE '%' + a.first_name + '%'
You only need to concatenate the strings, you could also do a search and replace.
SELECT
a.first_name,
b.age
FROM names a
JOIN ages b
ON b.full_name LIKE '%' + a.first_name + '%'