I am trying to select data from two tables and insert it into another one. I want to select the data when certain things match in each table. The problem is that one of the comparisons needs to be a like and I am at a loss. The sql statement is below and I believe that it will at least show what I am trying to do.
insert into hr_numbers
(`user_id`, `hr_number`)
select distinct u.user_id, t.num
from temp t, users u
where t.name like '%' + u.l_name + '%';
I have tried to use procedures but cannot figure that out or even tell if that would help.