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 simple sql help. the select command.  Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "simple sql help. the select command.  " Watch "simple sql help. the select command.  " New topic
Author

simple sql help. the select command.

bhavin ragha
Greenhorn

Joined: Mar 28, 2012
Posts: 17
I know this is simple sql. but i am trying to do a simple select command.
the command says


this works.

but my question is how do i put multiple values in. for example where cd_id = 'cd001', 'cd005', 'cd023'
Santhosh ayiappan
Ranch Hand

Joined: Jan 30, 2007
Posts: 70

You can use the "like" in the where clause instead of "=".
Martin Vajsar
Bartender

Joined: Aug 22, 2010
Posts: 2331
    
    2

Hi Bhavin, and welcome to the Ranch!

In your case, you could probably use the IN operator. I'd suggest reading some SQL tutorial, it will come in handy.

If you plan to run this statement using JDBC, you should also read a thing or two about PreparedStatement.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: simple sql help. the select command.
 
Similar Threads
converting a mysql DATETIME (HH:mm:ss) to seconds
oracle sequence id
Passing a Querystring from one page to the next
Inverse this where condition
oracle sequence id and table data insertion