ITeye博客

不同数据库分页

kingmxj · 2009-06-05 11:29 · Oracle · Blog · DB2 · .net · MySQL · Oracle · Markdown

MSSQL

如在ms sqlserver 用此语句:
select top 2 * from test01 就会只显示前2条记录,

MYSQL

select * from your_table limit 2

使用limit就可以了.

Oracle的语句:

select * from (select rownum r ,字段名 from test) tt
where tt.r > 50 and tt.r <= 100; (最好用PLSQL游标来解决)

DB2中:
select * from payment fetch first 5 row only --查前5条记录

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/PineApple0/archive/2008/03/22/2207150.aspx

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。