declare @KeyWordsCount as int select @KeyWordsCount = count(*) from Keywords with KeywordSearchCTE as (select * from myTable M INNER JOIN Keywords K on M.FieldToSearch like '%' + K.Search_Word + '%' UNION ALL select * from myTable M INNER JOIN Keywords K on M.FieldToSearch like '%' + K.Search_Word + '%' where K.Search_Word NOT IN (select Search_Word from KeywordSearchCTE)) select M.FieldToSearch, count(*) as cnt_Occurs from myTable M inner join KeywordSearchCTE K on M.ID = K.ID group by 1 having cnt_Occurs = @KeyWordsCountDo you think I'm going in the right direction?