Solved

about Max value

Posted on 1998-04-25
7
173 Views
Last Modified: 2010-04-16
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
Comment
Question by:mareakarlos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Expert Comment

by:jaked
ID: 1219712
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
 

Author Comment

by:mareakarlos
ID: 1219713
thats was not the answer i want..
thanx any way

0
 
LVL 2

Expert Comment

by:jaked
ID: 1219714
Maybe you should explain what you want then.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 6

Expert Comment

by:jpk041897
ID: 1219715
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
 

Author Comment

by:mareakarlos
ID: 1219716
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
 
LVL 4

Accepted Solution

by:
evijay earned 0 total points
ID: 1219717
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
 

Author Comment

by:mareakarlos
ID: 1219718
thats was a good answer
thank you

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
web application structure 18 134
Crystal Reports Licensing Questions 4 84
jsp error 6 70
ArrayList Adding/settign data 3 37
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question