I currently have a SQL query that returns results based on a dynamic number of keywords passed in.
I convert the list of keywords into a table and join to it.
SELECT * FROM Table1
INNER JOIN
dbo.udf_List2Table(@Keywords, ',') ON (Field1 LIKE '%'+Keyword+'%')
This is working fine but it returns all rows that contain any of the keywords that are suppiled. What I would like to do is return all rows that contain all of the keywords supplied.
I'm pretty sure you can't do this using a JOIN. Does anyone have any suggestions on how I could do this? I'm trying to avoid dynamic SQL.
Thanks