Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query limit rows in database

 
Sam Wang
Ranch Hand
Posts: 95
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are a good Man.Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic