---
title: "不同数据库分页"
author: "kingmxj"
date: "2009-06-05T11:29:04Z"
tags: [".net", "Blog", "DB2", "MySQL", "Oracle"]
slug: "untitled"
draft: false
lastmod: "2009-06-05T11:29:04Z"
id: 402393
url: "https://kingmxj.iteye.com/blog/402393"
---

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