Solved

about Max value

Posted on 1998-04-25
7
174 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

707 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