oracle sql分頁查詢(一)
14:36:47 SQL> select x.owner,x.object_name,x.object_id,x.status from (select rownum rn,a.* from test a) x where x.rn between 1 and 20;
Elapsed: 00:00:00.01
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 1984214786
----------------------------------------------------------
Plan hash value: 1984214786
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1607K| 174M| 4992 (3)| 00:01:00 |
|* 1 | VIEW | | 1607K| 174M| 4992 (3)| 00:01:00 |
| 2 | COUNT | | | | | |
| 3 | TABLE ACCESS FULL| TEST | 1607K| 64M| 4992 (3)| 00:01:00 |
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1607K| 174M| 4992 (3)| 00:01:00 |
|* 1 | VIEW | | 1607K| 174M| 4992 (3)| 00:01:00 |
| 2 | COUNT | | | | | |
| 3 | TABLE ACCESS FULL| TEST | 1607K| 64M| 4992 (3)| 00:01:00 |
----------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
---------------------------------------------------
1 - filter("X"."RN"<=20 AND "X"."RN">=1)
Select
Tname,
Tabtype
FROM
(Select
Tname,
Tabtype,
Rownum Rn
FROM
(SELECT * FROM Tab ORDER BY Tname
)
WHERE rownum <=150
)
WHERE rn>=100;
Tname,
Tabtype
FROM
(Select
Tname,
Tabtype,
Rownum Rn
FROM
(SELECT * FROM Tab ORDER BY Tname
)
WHERE rownum <=150
)
WHERE rn>=100;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-669904/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle總結【SQL細節、多表查詢、分組查詢、分頁】OracleSQL
- oracle分頁查詢Oracle
- Oracle分頁查詢語句(一)Oracle
- Oracle的分頁查詢Oracle
- Oracle分頁查詢格式Oracle
- MySQL、Oracle和SQL Server的分頁查詢語句MySqlOracleServer
- Oracle分頁查詢格式(十三)Oracle
- Oracle分頁查詢格式(十二)Oracle
- Oracle分頁查詢格式(十一)Oracle
- Oracle分頁查詢格式(八)Oracle
- Oracle分頁查詢格式(九)Oracle
- Oracle分頁查詢格式(十)Oracle
- oracle分頁查詢語句Oracle
- Oracle分頁查詢之order byOracle
- Oracle中的SQL分頁查詢原理和方法詳解OracleSQL
- Sql Server系列:查詢分頁語句SQLServer
- Oracle分頁查詢語句(七)Oracle
- Oracle分頁查詢語句(六)Oracle
- Oracle分頁查詢語句(五)Oracle
- Oracle分頁查詢語句(四)Oracle
- Oracle分頁查詢語句(三)Oracle
- Oracle分頁查詢語句(二)Oracle
- 有關Oracle分頁查詢語句Oracle
- MySql/Oracle和SQL Server的分頁查MySqlOracleServer
- Elasticsearch 分頁查詢Elasticsearch
- ssh 分頁查詢
- oracle 資料分頁查詢 (轉貼收集)Oracle
- 最新+最簡單Oracle分頁查詢法Oracle
- Oracle資料庫中的分頁查詢Oracle資料庫
- MySQL的分頁查詢MySql
- ThinkPhp框架:分頁查詢PHP框架
- 分頁查詢優化優化
- NET 集合分頁查詢
- MySQL 多表查詢分頁MySql
- 分頁查詢重構
- Lucene的分頁查詢
- Oracle_Day2 查詢練習,以及分頁Oracle
- SQL 單表多條記錄分組查詢分頁程式碼SQL