aspose file tools*
The moose likes JDBC and the fly likes Query limit rows in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Query limit rows in database" Watch "Query limit rows in database" New topic
Author

Query limit rows in database

Sam Wang
Ranch Hand

Joined: Jul 17, 2001
Posts: 95
[mysql]
select * from XXXtable limit [offset,] rows
[oracle]
select * from XXXtable where rownum < rowindex
[sqlserver]
select * top rows from XXXtable
In my opinion,mysql is the best at this function!


SCJP(2001)
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

OR in java for all three databases:

In my opinion, this is the best way so you're not finding/changing all your queries when you change databases!
Jamie
Sam Wang
Ranch Hand

Joined: Jul 17, 2001
Posts: 95
You are a good Man.Thanks.
 
wood burning stoves
 
subject: Query limit rows in database