File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL for lowest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL for lowest" Watch "SQL for lowest" New topic
Author

SQL for lowest

James Hewitt
Greenhorn

Joined: Jul 09, 2001
Posts: 27
I'm using JDBC to get values from a db2 database into a servlet. There is a column of integer values from which I want to retrieve the lowest value, but my sql isn't really up to it.
Is there an SQL statement which automatically returns the lowest value in a column?
Thanks,
James
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
use the aggregate function MIN.
e.g. SELECT MIN(i) FROM tablename;


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL for lowest
 
Similar Threads
Decimal precision and scale
db2 - 703 certification
DB2 700 and 701 - Test Sample
On SQL Error 407
how to search values in database