I have a table that has columns like this for example:
id,col1,col2,col3,col4
Now, I want to check if ANY
of col1, col2, col3, col4
have the passed in value.
The long way to do it would be..
SELECT * FROM table WHERE (col1 = 123 OR col2 = 123 OR col3 = 123 OR col4 = 123);
I guess it's the opposite version of IN
.
Is there an easier way to do what I want?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…