File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Is this possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Is this possible?" Watch "Is this possible?" New topic
Author

Is this possible?

Sabarish Sasidharan
Ranch Hand

Joined: Aug 29, 2002
Posts: 73
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'))


Sab<br /> <br />Perfection does not come from belief or faith. Talk does not count for anything. Parrots can do that. Perfection comes through selfless work.<br />Swami Vivekananda
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Sabarish,
You can do the same thing with the union operator:

This approach has the advantage of being portable across databases.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

General SQL questions go in the JDBC forum (at the top of the forum list.) I'll move this there for you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this possible?