I have an issue with selecting from a table where I want to select all records where ALL the words I specify is present.
Record 1: "samsung galaxy s8 black"
Record 2: "samsung note 8 gold"
If the search parameter is: "sam gal s8" I want to ONLY get record 1 and this work if I build the LIKE '%sam%%gal%%s8%'
If I use EXIST I will get both this records
I also want to get the same result if I search for '%gal%%s8%%sam%' but I have not found a solution for this.
The solution I'm looking for is the same as if I used this in the WHERE clause:
( isnull(itemtext,'') like '%gal%' AND isnull(itemtext,'') like '%s8%' AND isnull(itemtext,'') like '%sam%')
Do anybody have a solution for this without having to use temp tables and "exec sp_executesql" ??