1.MSSQL
a)查询前n条记录:
select top n * from table_name;
b)查询第n条到第m条记录:
select top n * from (select top m * from table_name order by column_name) a order by column_name desc
2. MySQL
a) 查询前n条记录
select * from table_name limit 0,n
b) 查询第n条到第m条
select * from table_name limit n,m
3.oracle
a)查询前n条记录
select * from table_name where rownum<n
b)查询第m条到第n条记录:
select * from (select a.*,a.rownum rn from (select * from table_name) a where a.rownum<m) where rn>n