There are two tables,
Categories(Id, Name) Products(Id, Text, CategoryId)
There is another table for filtering products:
Filter(CategoryIds, ContainText)
CategoryIds in Filter table is a comma-separated: 100,101
We want to query products based on criteria extracted from Filters table.
Example: Filters have only two records:
CategoryIds | ContainText ----------------------------- 100,101 | A 200,201 | B
Here are products we want to query:
containting text 'A' in categories 100 or 101
Or
containting text 'B' in categories 200 or 201
We would not like to use dynamic query.
Thanks for any help.