• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • 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

1 Solution
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.

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

Maybe you should explain what you want then.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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?
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 .

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

mareakarlosAuthor Commented:
thats was a good answer
thank you

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

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