A user can choose a list of option combinations and then search for them.
The sql could look like this.
select * from p where (option_type = 'X' and value = 'A')
or (option_type = 'X' and value = 'B')
or (option_type = 'Y' and value = 'D')
But of course I do not want to have n number of or's
How would a good sql look like that performs ??? The user can choose many option combinations.
Thanks.
ORfor each possible condition unacceptable?WHERE (option_type = 'X' and value in ('A','B')) or (option_type = 'Y' and value in ('D', ... )ors that is acceptable? i'm not sure there's another way besides storing the pair combinations in a table and joining on those values. maybe... if you provide us with sample data, table structure, where these combinations come from and example input there's a better approach someone can suggest