关于Oracle,sqlserver,mysql中查询10-20条记录的写法

一: oracle数据库写法:php

1:select * from (select rownum rn ,* from 表名 where?rownum<20?) a?mysql

?where a.rn>10linux

2:select * from 表名 where rownum<20sql

  minus数据库

  select * from 表名 where rownum<10oracle

?sqlserver

二:SqlServer数据库写法:ui

1:select top 20 * from tablename where id not?exists (select top?10 * from tablename)//前20条记录再过滤掉前10条url

2:select top10 * from (select top 20 * from order by column) order by column desc//子查询中取20条倒序,而后从子查询中取前10条spa

三:mysql的写法:

select * from tablename where LIMIT 9,10

相关文章
相关标签/搜索