UNCMoochie
Programmer
I am trying to create a query where 50% or more of the options in my where clause are true. For example lets say i have 4 cols for a record that relate to some kind of code.
call them Col1, Col2, col3, col4. Instead of writing out all the different permutations of ways 75% or more of the values could be true is there a better way?
currently i have:
where (col1 = 1 and col2 = 1 and col3 = 1 and col4 = 1)
or (col1 = 0 and col2 = 1 and col3 = 1 and col4 = 1)
or (col1 = 1 and col2 = 0 and col3 = 1 and col4 = 1)
or (col1 = 0 and col2 = 0 and col3 = 1 and col4 = 1)
etc... etc... until i get every possible combination.
any help would be greatly appreciated.
call them Col1, Col2, col3, col4. Instead of writing out all the different permutations of ways 75% or more of the values could be true is there a better way?
currently i have:
where (col1 = 1 and col2 = 1 and col3 = 1 and col4 = 1)
or (col1 = 0 and col2 = 1 and col3 = 1 and col4 = 1)
or (col1 = 1 and col2 = 0 and col3 = 1 and col4 = 1)
or (col1 = 0 and col2 = 0 and col3 = 1 and col4 = 1)
etc... etc... until i get every possible combination.
any help would be greatly appreciated.