Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

about sybase sql "in" operator

74 views
Skip to first unread message

hujing

unread,
Oct 28, 2011, 10:56:35 PM10/28/11
to
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.

hujing

unread,
Oct 28, 2011, 10:53:46 PM10/28/11
to

ziona...@gmail.com

unread,
Apr 16, 2012, 4:17:14 AM4/16/12
to
did you check the execution plan of your request ?
0 new messages