This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes simple sql help. the select command.  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "simple sql help. the select command.  " Watch "simple sql help. the select command.  " New topic

simple sql help. the select command.

bhavin ragha

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: 80

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

Joined: Aug 22, 2010
Posts: 3718

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: simple sql help. the select command.
It's not a secret anymore!