File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query limit rows in database

 
Sam Wang
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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!
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are a good Man.Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic