greenplum/postgres 分页语法

 
  1. select [*|字段列表] from table_name where expresion [limit {count|all}] [offset start];
  2. --limit:指定select结果的显示条数
  3. --offset:指定数据检索的起始位置
 

MySQL 分页语法

 
  1. select [*|字段列表] from table_name where expresion limit m,n;
  2. --m:数据检索的其实位置
  3. --n:每页显示的数据条数
 

SQLServer 分页语法

 
  1. --方式一
  2. select top pageSize * from 表名 where id not in (select top pages id from 表名 order by id) order by id
  3. --方式二
  4. select top pageSize * from 表名 where id>=(select max(id) from (select top pages id from 表名 order by id asc ) t )
  5. --pageSize:每页显示的数据条数
  6.  
 

Oracle/DB2 分页语法

 
  1. select [*|字段列表] from table_name where 字段>=startPage and 字段<endPage;
  2. --startPage:起始位置
  3. --pageSize:每页显示的数据数
  4. --endPage:startPage+pageSize