views:

36

answers:

1

I wrote this but it only returns exact matchs such as 'Carburetor' not 'Brand X Carburetor' Any help would be greatly appreciated!

SELECT [Col]
 FROM a 
 WHERE ([Col]) IN
  (   SELECT [col]
      FROM B
  )
UNION ALL
   SELECT Distinct [col]
   FROM B
   WHERE  ([col]) IN
    (
       Select [col]
       FROM A 
    )
+1  A: 

Using SQL Server, you might try as follow.

SELECT  a.[Col] 
FROM    a  
        INNER JOIN b ON a.Col LIKE '%' + b.Col + '%'
UNION ALL 
SELECT  Distinct b.[col] 
FROM    b
        INNER JOIN a ON b.COL LIKE '%' + a.Col + '%'
Lieven
Golden, THank you!
You are welcome.
Lieven