表如下:
id col1 col2 col3 1 r g b 2 g r -- 3 r -- g
尝试一下:
select * from test where 'r' in (col1, col2, col3)
或此:
select * from test where col1 = 'r' or col2 = 'r' or col3 = 'r';
Here is the demo for Oracle.