Simple pattern matching with LIKE.
Q&A for anime and manga fans
-- Demo for Aldonas -- Simple pattern matching with LIKE. CREATE table #a (a_id INT PRIMARY KEY, name nvarchar(100)); INSERT INTO #a values (1, 'Copmputex S.A'), (2, 'CityComp'), (3, 'Netland technology'), (4, 'Voip Service Mexico'), (5, 'Synergy'), (6, 'Netitlan Corp') CREATE table #b (b_id INT PRIMARY KEY, name nvarchar(100)); INSERT INTO #b values(1, 'Synergy'), (2, 'Netland'), (3, 'CityComp'), (4, 'Netitlan'), (5, 'Copmputex'), (6, 'VoipService') SELECT a.name, b.name FROM #a a, #b b WHERE a.name LIKE (b.name + '%');