• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this possible?

 
Sabarish Sasidharan
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not an oracle specific question. This is more a SQL question. Did not find another suitable forum for this. So posting here.

select * from xxx where (xxx.a, xxx.b) = ('20', '30')

is a working SQL.

Does anyone know how this SQL should be modified to work with the IN operator and possibly with multiple values

Ideally i want to do something like this
select * from xxx where (xxx.a, xxx.b) in (('20','30'), ('30', '40'))
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33674
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sabarish,
You can do the same thing with the union operator:

This approach has the advantage of being portable across databases.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33674
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
General SQL questions go in the JDBC forum (at the top of the forum list.) I'll move this there for you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic