This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple sql help. the select command.

 
bhavin ragha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 80
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the "like" in the where clause instead of "=".
 
Martin Vajsar
Sheriff
Pie
Posts: 3751
62
Chrome Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic