联合查询的字段名称及排序考点(附加闪回知识点)
来源:互联网 发布:大数据的起源是什么 编辑:程序博客网 时间:2024/06/06 02:24
create table CUSTOMERS
(
CUST_ID NUMBER(5),
CUST_LAST_NAME VARCHAR2(10),
COUNTRY_ID NUMBER(5)
);
insert into CUSTOMERS (CUST_ID, CUST_LAST_NAME, COUNTRY_ID)
values (1, 'jane', 10);
insert into CUSTOMERS (CUST_ID, CUST_LAST_NAME, COUNTRY_ID)
values (2, 'hanmeimei', 20);
insert into CUSTOMERS (CUST_ID, CUST_LAST_NAME, COUNTRY_ID)
values (3, 'lily', 30);
commit;
SELECT * FROM customers;
FROM customers
WHERE country_id=10
UNION
SELECT cust_id cust_no,cust_last_name
FROM customers ActualTests
WHERE country_id=30
ORDER BY 2,1;
SELECT cust_id,cust_last_name "Last Name"
FROM customers
WHERE country_id=10
UNION
SELECT cust_id cust_no,cust_last_name
FROM customers ActualTests
WHERE country_id=30
ORDER BY 2,cust_id;
SELECT cust_id,cust_last_name "Last Name"
FROM customers
WHERE country_id=10
UNION
SELECT cust_id cust_no,cust_last_name
FROM customers ActualTests
WHERE country_id=30
ORDER BY "Last Name";
以上三个的结果都是:
FROM customers
WHERE country_id=10
UNION
SELECT cust_id cust_no,cust_last_name
FROM customers ActualTests
WHERE country_id=30
ORDER BY cust_no;
SELECT cust_id,cust_last_name "Last Name"
FROM customers
WHERE country_id=10
UNION
SELECT cust_id cust_no,cust_last_name
FROM customers ActualTests
WHERE country_id=30
ORDER BY "cust_no";
以上两个的结果都是:
DROP TABLE customers;
SELECT * FROM customers;
FLASHBACK table customers to before drop;
SELECT * FROM customers;
alter table customers DISABLE row movement;(系统原本是开启的,我修改成不可用以便进行测试)
UPDATE customers SET cust_last_name='lilei' WHERE cust_id=2;
COMMIT;
flashback table customers to TIMESTAMP systimestamp - interval '2' minute;
SELECT * FROM customers;
alter table customers enable row movement; (闪回表必须要开启行移动功能!)
UPDATE customers SET cust_last_name='hanmeimei' WHERE cust_id=2;
COMMIT;
flashback table customers to TIMESTAMP systimestamp - interval '1' minute;
SELECT * FROM customers;
DROP TABLE customers;
select * from user_recyclebin;
FLASHBACK table customers to before drop;
drop table customers purge;
FLASHBACK table customers to before drop;
- 联合查询的字段名称及排序考点(附加闪回知识点)
- wordpress通过文章的附加字段查询文章(query_posts)
- 解决Mysql数据库实现多表联合查询及按照其中一个字段进行排序问题
- 常见数据库查询表名称,字段名称的sql
- sql查询表中所有字段名称及类型
- oracle 快速检索表名称及包含的字段名称
- 查询oracle表的信息(表,字段,约束,索引) 按列名+表名查询约束名称
- 查询oracle表的信息(表,字段,约束,索引) 按列名+表名查询约束名称
- SQL中查询数据表字段名称的查询语句
- mysql两个字段相同的表联合查询(union的使用)
- SQLServer关于类似于联合主键的字段查询
- 排序算法的一些考点
- ASP读取表的字段名称及字段数目
- ASP读取表的字段名称及字段数目
- 多表查询,获取另一个表中的字段名称,作为此表的字段名称。
- 多线程知识点 考点汇总-(上)
- d3.js的关系图初试(附加拖拽、缩放及根据自定义名称确定节点)
- 查询数某个表(视图)的所有字段名称类型等
- 你有过成功的经历吗
- Android 2.3 Json解析出错
- 非国家宏观寂寞
- TCP状态迁移图浅析
- sublime text (ST)一篇通(安装、配置、扩展、使用)
- 联合查询的字段名称及排序考点(附加闪回知识点)
- iOS小效果(2)按钮控制图片的放大缩小
- 不小心删除的u盘文件怎么恢复
- stray '/241' in program 错误
- Gibbs sampling [Gibbs采样]1
- 基于 REST 的 Web 服务:基础
- 网络游戏MMORPG服务器架构
- 图片上传----续
- 【调用javacv进行人脸识别 总是出现 无法找到 java.util.Arrays.copyOf】