oracle:标签:10,top,sqlserver,order,mysql,oracle,table,id,select From: https://blog.51cto.com/hzc2012/6000170
SELECT * FROM table WHERE ROWNUM<101;
minus
SELECT * FROM table WHERE ROWNUM<91;
mysql:
select * from table limit 5,5
第一个5是开始的行号,第二个5是选择纪录的数量
sqlserver:
select top 10 * from table where [column id] not in ( select top 10 [column id] from table )
以下选择87~96行的10行数据:
select top 10 id from (select top 96 id from aa order by id asc)as kk order by id desc
这些语句可以用于不同数据库的分页
随机10行:
select top 10 * from aa order by newid()