KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to compare the individual words from the user input to individual words from a column in my table. For example, consider these rows in my table: ID Name 1 Jack Nicholson 2 Henry Jack Blueberry 3 Pontiac Riddleson Jack Consider that the user's input is 'Pontiac Jack'. I want to assign weights/ranks for each match, so I can't use a blanket LIKE (WHERE Name LIKE @SearchString). If Pontiac is present in any row, I want to award it 10 points. Each match for Jack gets another 10 points, etc. So row 3 would get 20 points, and rows 1 and 2 get 10. I have split the user input into individual words, and stored them into a temporary table @SearchWords(Word). But I can't figure out a way to have a SELECT statement that allows me to combine this. Maybe I'm going about this the wrong way? Cheers, WT
Tags (comma-separated)
Save Edits
Cancel