aspose 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
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