ArcSDE10.2.1使用Oracle12c新特性分页
Jun 07, 2016 pm 03:51 PM在Oracle 12c推出之后,其中一个新特性就是分页语句。 Easy Top-N and pagination queries ,更易用的Top-N和页码查 询提供了类似MySQL中limit的语法,Row Limiting Clause 注意:该功能是Oracle12c的新特性,并不是ArcGIS的新特性。 语法介绍 row_limiting_
在Oracle 12c推出之后,其中一个新特性就是分页语句。
Easy Top-N and pagination queries ,更易用的Top-N和页码查
询提供了类似MySQL中limit的语法,Row Limiting Clause
注意:该功能是Oracle12c的新特性,并不是ArcGIS的新特性。
语法介绍
<span>row_limiting_clause</span>
The <span>row_limiting_clause</span>
allows you to limit the rows returned by the query. You can specify an offset, and number of rows or percentage of rows to return. You can use this clause to implement top-N reporting. For consistent results, specify the <span>order_by_clause</span>
to ensure a deterministic sort order.
OFFSET
Use this clause to specify the number of rows to skip before row limiting begins. <span>offset</span>
must be a number. If you specify a negative number, then <span>offset</span>
is treated as 0. If you specify NULL, or a number greater than or equal to the number of rows returned by the query, then 0 rows are returned. If <span>offset</span>
includes a fraction, then the fractional portion is truncated. If you do not specify this clause, then <span>offset</span>
is 0 and row limiting begins with the first row.
ROW | ROWS These keywords can be used interchangeably and are provided for semantic clarity.
FETCH
Use this clause to specify the number of rows or percentage of rows to return. If you do not specify this clause, then all rows are returned, beginning at row <span>offset</span>
+ 1.
FIRST | NEXT These keywords can be used interchangeably and are provided for semantic clarity.
<span>rowcount</span> | <span>percent</span> PERCENT Use <span>rowcount</span>
to specify the number of rows to return. <span>rowcount</span>
must be a number. If you specify a negative number, then <span>rowcount</span>
is treated as 0. If <span>rowcount</span>
is greater than the number of rows available beginning at row <span>offset</span>
+ 1, then all available rows are returned. If <span>rowcount</span>
includes a fraction, then the fractional portion is truncated. If <span>rowcount</span>
is NULL, then 0 rows are returned.
Use <span>percent</span>
PERCENT
to specify the percentage of the total number of selected rows to return. <span>percent</span>
must be a number. If you specify a negative number, then <span>percent</span>
is treated as 0. If <span>percent</span>
is NULL, then 0 rows are returned.
If you do not specify <span>rowcount</span>
or <span>percent</span>
PERCENT
, then 1 row is returned.
ROW | ROWS These keywords can be used interchangeably and are provided for semantic clarity.
ONLY | WITH TIES Specify ONLY
to return exactly the specified number of rows or percentage of rows.
Specify WITH
TIES
to return additional rows with the same sort key as the last row fetched. If you specify WITH
TIES
, then you must specify the<span>order_by_clause</span>
. If you do not specify the <span>order_by_clause</span>
, then no additional rows will be returned.
当然,大家最喜欢看的就是实际的例子,总结上面就是,在Oracle12c
环境下,提供了更加方便的分页语句,而不再使用Rownum对象了。
测试环境:
ArcSDE10.2.1、Oracle12.1.0.1
1 2 3 4 5 6 7 8 9 10 11 |
|
----------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
----------------------------------------------------------------------------------
1:获得前N条记录的语句
语法: fetch first N rows only;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
第一步:先把过滤第1到第N-1的数据
第二步:然后再获得第N到M的数据
----------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
----------------------------------------------------------------------------------
3:获得前百分比N的语句
语法: fetch first N percent rows only;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
----------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
----------------------------------------------------------------------------------
PS:该功能目前可以在ArcGIS Desktop中使用,但是不能再
REST中使用。

Article chaud

Outils chauds Tags

Article chaud

Tags d'article chaud

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

Comment utiliser les liens magnétiques

Comment utiliser les fichiers mdf et mds

Quel logiciel est CrystalDiskmark ? -Comment utiliser crystaldiskmark ?

Comment télécharger foobar2000 ? -Comment utiliser foobar2000

Comment utiliser Xiaoai Speaker Comment connecter Xiaoai Speaker à un téléphone mobile

Comment utiliser l'application Baidu Netdisk

Comment utiliser NetEase Mailbox Master

Guide simple de la source du miroir pip : maîtrisez facilement comment l'utiliser
