常用数据库 取前几条数据 sql写法

来源:互联网 发布:学生空间七天网络下载 编辑:程序博客网 时间:2024/06/06 08:49

MS SqlServer

select top 10 * from table

 


MYSQL
select * from table where .... limit 10;

Oracle

select * from (select rownum r ,* from table) t where t.r > 5 and t.r <= 10; (最好用PLSQL游标来解决)

DB2

select * from payment fetch first 10 row only

 

 

原创粉丝点击