dbTalk Databases Forums  

about sybase sql "in" operator

sybase.public.ase.general sybase.public.ase.general


Discuss about sybase sql "in" operator in the sybase.public.ase.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
hujing
 
Posts: n/a

Default 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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.