oracle 12c新特性 FETCH FIRST、WITH TIES 关键字详解
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
OFFSET 5 ROWS FETCH first 5 ROWS ONLY for update ;
SELECT employee_id, last_name
*
ERROR at line 1:
ORA-02014: cannot select FOR UPDATE from view withDISTINCT, GROUP BY, etc.
SELECT seq.currval,employee_id, last_name
FROM employees
ORDER BY employee_id
OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY
/ SELECT seq.currval,employee_id, last_name
*
ERROR at line 1:
ORA-02287: sequence number not allowed here
CREATE MATERIALIZED VIEW LOG ON employees withprimary key ; Materialized view log created. CREATE MATERIALIZED VIEW mym REFRESH FAST AS
(
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
FETCH FIRST 5 ROWS ONLY
)
/ FETCH FIRST 5 ROWS ONLY
*
ERROR at line 6:
ORA-12015: cannot create a fast refresh materializedview from a complex query
CREATE MATERIALIZED VIEW mym REFRESH FAST AS
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
/ Materialized view created. CREATE MATERIALIZED VIEW mym
as
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
FETCH FIRST 5 ROWS ONLY
/ FETCH FIRST 5 ROWS ONLY
*
ERROR at line 6:
ORA-00933: SQL command not properly ended
CREATE MATERIALIZED VIEW mym
as
(SELECTemployee_id, last_name
FROM employees
ORDER BY employee_id
FETCH FIRST 5 ROWS ONLY)
/
先来几个例子
The following statement returns the 5 employeeswith the
lowest employee_id values:
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
FETCH FIRST 5 ROWS ONLY;
下面返回的是跳过empid最小的5行的下5行数据。
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY;
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY;
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY;
oracle 12c新特性 FETCH FIRST、WITH TIES 关键字详解的更多相关文章
- Oracle 12c新特性
转载自:Oracle 12c新特性(For DBA) 一: Multitenant Architecture (12.1.0.1) 多租户架构是Oracle 12c(12.1)的新增重磅特性 ...
- Oracle 12C 新特性之扩展数据类型(extended data type)
Oracle 12C 新特性-扩展数据类型,在12c中,与早期版本相比,诸如VARCHAR2, NAVARCHAR2以及 RAW这些数据类型的大小会从4K以及2K字节扩展至32K字节.只要可能,扩展字 ...
- oracle 12c 新特性之(相同字段上的多重索引、ddl 日志、限制PGA的大小、分页查询)
1. 相同字段上的多重索引 在Oracle 12c R1之前,一个字段是无法以任何形式拥有多个索引的.或许有人会想知道为什么通常一个字段需要有多重索引,事实上需要多重索引的字段或字段集合是很多的. ...
- Oracle 12c 新特性之 数据库内归档(In-Database Archiving)
Oracle Database 12c中引入了 In-Database Archiving的新特性, 该特性允许用户通过对表上的数据行标记为inactive不活跃的,以归档数据. 这些inactive ...
- ORACLE 12C新特性——CDB与PDB
Oracle 12C引入了CDB与PDB的新特性,在ORACLE 12C数据库引入的多租用户环境(Multitenant Environment)中,允许一个数据库容器(CDB)承载多个可插拔数据库( ...
- Oracle 12C 新特性之 PDB热克隆(本地克隆、远端异机克隆)
说明:版本12.2.0.1 12c r1版本中 clone 一份PDB源库需要打开在read only只读模式 , 在12c r2版本中引入了local undo mode, 源PDB在read/wr ...
- Oracle 12c新特性之——TABLE ACCESS BY INDEX ROWID BATCHED
Oracle12c开始,我们在获取SQL语句的执行计划时,也会经常看到"TABLE ACCESS BY INDEX ROWID BATCHED"操作,那么,这个操作到底是什么意思呢 ...
- Oracle 12c新特性(For DBA)
一: Multitenant Architecture (12.1.0.1) 多租户架构是Oracle 12c(12.1)的新增重磅特性,内建的多分租(Multi-tenancy),一个容器 ...
- Oracle 12C 新特性之 db默认字符集AL32UTF8、PDB支持不同字符集
一. db默认字符集AL32UTF8Specify the database character set when you create the database. Starting from Ora ...
随机推荐
- printf和std::cout ...endl
printf效率要比std::cout...endl高些,可以减少打印所花时间
- getAttribute与getParameter的区别
1.getParameter得到的是字符串,其取值源于jsp页面,从jsp页面中接受一个存在的参数,多用于servlet中,用于判断业务的类型和跳转页面.如: request.getParameter ...
- HDU 1298 T9(字典树+dfs)
http://acm.hdu.edu.cn/showproblem.php?pid=1298 题意:模拟手机9键,给出每个单词的使用频率.现在给出按键的顺序,问每次按键后首字是什么(也就是要概率最大的 ...
- PHP 时间函数time、date和microtime的区别
一.time.date 和 microtime函数 time----返回当前的 Unix 时间戳 date----格式化一个本地时间/日期 microtime----返回当前的 Unix 时间戳和微秒 ...
- ASP.NET开发总结
ASP.NET的界面可以是.aspx,会对应有一个.aspx.cs的逻辑处理文件,.aspx的所有控件对应着变量,变量名就是控件的ID. 为了代码编写方便起见,一般将数据库表的新增字段,放在最后. 日 ...
- [原][osg][osgearth]倾斜摄影1.介绍
总体介绍: 倾斜摄影就是将拍好的数据,三角网格化再附上贴图. 目前流行处理软件: Street Factory.PIX4DMapper.smart3D 后期开发平台:超图 Skyline smart3 ...
- ImageConverter引起的 invalid address or address of corrupt block 0xb7feab58 passed to dlfree
虹软人脸识别,其方法要传NV21格式的byte[], github上有一个虹软的Demo,是不是虹软工作人员写的不清楚,这个Demo里bitmap转NV21格式byte[]用的是一个第三方库https ...
- 学习笔记29—Linux基础
一.简单命令: 1.进入文件夹heyi目录:cd ./heyi 2.查看该目录下内容:ls 二.linux压缩和解压缩命令大全 tar命令 解包:tar zxvf FileName.tar 打包:ta ...
- python入门知识点(上)
1.硬件系统: 主机部分: 1.中央处理器(CPU): 电脑的大脑 运算器: 数值计算和逻辑判断 控制器: 可以电脑中的各个部件协同工作 2.内部存储器: 随机存储器:内存条 使用电信号表示数据; 特 ...
- js判断手指的上滑,下滑,左滑,右滑,事件监听
原理:1:当开始一个touchstart事件的时候,获取此刻手指的横坐标startX和staerY: 2:当触发touchmove事件的时候,再获取此时手指的横坐标moveEndX和纵坐标moveEn ...