I have two columns in two different tables. They can both contain data thats similar. For example column what would have stack
and column 2 would have stack overflow
in. The data varies from line to line though, What i want to do is do a LIKE to return only the rows that match so if each one has the same word in (even if there are other words) then it returns the value. I I've tried a few like's with % but cant seem to get it?
Asked
Active
Viewed 56 times
1

GPH
- 1,817
- 3
- 29
- 50
-
2Can you post your query as well as DB schema ? – Raptor Aug 20 '13 at 07:56
-
You can probably link them fairly easily as long as one will always entirely contain the other, if not it gets VERY difficult. – bendataclear Aug 20 '13 at 07:56
1 Answers
0
Not knowing much about sql-server, so i won't be able to write down a code, but i think this steps would help you solvle the problem.
You need to split the values to words in both tables, you might need to a create a function for that purpose. This link might help you with that T-SQL split string
Then join the tables, and write down a filtering statement of where clause saying;
t1.words in (t2.words) or t2.words in (t1.words)
SOME|ANY keywords might help you with that.