access:
select top (10) * from table1
db2:
select 列名 from table1 where 1=1 fetch first 10 rows only
mysql:
select * from table1 limit 10 或 select * from table1 limit 0,10
sql server:
读取前10条:select top (10) * from table1 where 1=1
在sqlserver里面,若每页显示perpage条记录,按照id的排序,取第pageno页的记录:
select top perpage*pageno * from table where id not in(select top (pageno-1)*perpage id from table1)
oracle取前10条:
select * from table1 where rownum<=10
oracle取第11-20条:
select * from (select *,rownum num from table1 where rownum<=20) where num>=10;
oracle按id排序后取11-20条
select * from (select *,rownum num from (select * from table1 tt order by id desc) where rownum<=20) where num>=10;
关于mysql 的limit 子句的使用方法:

LIMIT 子句可以被用于强制 SELECT 语句返回指定的记录数。LIMIT 接受一个或两个数字参数。参数必须是一个整数常量。如果给定两个参数,第一个参数指定第一个返回记录行的偏移量,第二个参数指定返回记录行的最大数目。初 始记录行的偏移量是 0(而不是 1): 为了与 PostgreSQL 兼容,MySQL 也支持句法: LIMIT # OFFSET #。









转载于:https://blog.51cto.com/tianjin/563605