Hi Guys,
Is there any easy way to find out at least one column contains matching value
Ex
id | val1 | val2 | val3 | val4 | val5 | val6 |
A | 1 | 0 | 1 | 0 | 1 | 1 |
B | 0 | 0 | 0 | 0 | 0 | 0 |
C | 0 | 1 | 0 | 1 | 0 | 0 |
Any row with atleast one column contains 1
Result:
A
C
I dont want to check each column in where clause coz I have more than 10 columns in the table
Thanks
No comments:
Post a Comment