about sybase sql "in" operator -
10-28-2011
, 09:53 PM
I know sybase sql "in" operator is very efficient.
But I want to apply "in" operator in more than one column, such as.
select * from table_name where (col1,col2) in (('1','2'),('3','4');
Equivalent sql statement is :
statement 2
select * from table_name where (col = '1' and col2 = '2') or (col =
'3' and col2 = '4')
but I test statement 2 in sybase iq 15.3 , it is very inefficient.
So, I want to know how apply "in" operator in more than one column, or
is there any alternative solution to slove this question.
Thanks for any reply. |