mysql select a.*,b.* from a left join b on b.name like CONCAT(a.name,'%') sqlserver select a.*,b.* from a left join b on b.name like a.name+'%'