Solved

about Max value

Posted on 1998-04-25
7
166 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
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
network + 7 73
pairstar challenge 2 42
java set up 1 48
Saving Tweets with emojis using Twitter4J in a Mysql table 2 53
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now