Avatar of Cobra967
Cobra967
Flag for United States of America asked on

How to join two table with partial match

Hello, need your expect help to refine my View in order to join two tables with partial match of the whole word list. In the attached screenshot, ProductID 12 and 36 should not be listed because the whole word in ProductName is not = to "Mix" but SillMix and MixPastora.  

SELECT        dbo.Products.ProductID, dbo.Products.ProductName, dbo.NAMES.FullName
FROM            dbo.Products INNER JOIN
                         dbo.NAMES ON dbo.Products.ProductName LIKE '%' + dbo.NAMES.FullName + '%'

Open in new window

Output-Example.jpg
Microsoft SQL Server

Avatar of undefined
Last Comment
Shalu M

8/22/2022 - Mon
SOLUTION
Shalu M

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Cobra967

ASKER
Thank you Shalu, the problem is that dbo.NAMES.FullName has a very lengthy (8k) list of key words that I need to match in the dbo.Products.ProductName to run an update on.
ASKER CERTIFIED SOLUTION
Cobra967

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Shalu M

Asker commented saying the query he posted works for him.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23