select EmpName,(select COUNT(*) from HRLate where Name like '%' + t.EmpName + '%') from BaseEmployee t