Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

about Max value

how can i get Max value in set result that contains a table
of SQL?
  please answer me as soon as you could

thanx
0
mareakarlos
Asked:
mareakarlos
1 Solution
 
jakedCommented:
This isn't really a Java question, but I assume you're using JDBC. The standard SQL syntax is

select max(foo) from bar

to find the maximum value of the foo field in table bar. You'll get back a row with one element, the max value.

0
 
mareakarlosAuthor Commented:
thats was not the answer i want..
thanx any way

0
 
jakedCommented:
Maybe you should explain what you want then.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jpk041897Commented:
I belive he is reading a result set for display in, say a grid, and also needs the MAX value for one or more columns.

Is this the case?
0
 
mareakarlosAuthor Commented:
yes jpk ,,, yes indead.
thats what i'm looking for.
if u know how to do it.
write me the code for it
as soon as you can .


0
 
evijayCommented:
use the following tag with the max function in sql statement

select max(foo) "mymaxfoo"
from bar


Then, use the tagname mymaxfoo in the result set accessor functions in the same way as you use column name in simple sql expressions

Infact you can use the index based accessor functions getInt(0) where 0 is the index of the first column in the result set


0
 
mareakarlosAuthor Commented:
thats was a good answer
thank you

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now