Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC & Oracle

 
Pandurangan Rakesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I dont knwo whether this is a question realted to JDBC.Can u pls tell me the answer?The following are the rows in a table say EXAMPLE.

NAME AGE

JAMES 23
JANY 25
RAMAN 25
VIJAY 27
KALA 25

Now whats the query for getting a single row with AGE=25?i dont wont multiple rows..i want any (only one ) row.pls help me
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is sort of related to JDBC, but it isn't a JDBC question. You are asking a SQL question. I'd recommend going to learn SQL before you attempt any JDBC. Try here for a very basic introductory tutorial.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pandurangan,
How do you want to pick which of the 25 year olds to return? Is it random? You can always just get the first row from the result set. Some databases also have vendor specific ways of limiting the number of rows returned from a query.

SQL questions are ok here too!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35266
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pandurangan,
I just reread the subject and realized you are using Oracle. You can do something like this:

 
Pandurangan Rakesh
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne & Paul...i am using oracle.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic