oracle - 客户快照
问题描述
我想创建客户表的快照,并在拍摄快照时添加参考日期。
select * from customer_dump;
select * from customer_snapshot;
select count(*) into b
from user_tables
where table_name = upper('customer_snapshot_dump');
if b = 1 then
execute immediate 'drop table customer_snapshot_dump purge';
end if;
EXECUTE IMMEDIATE 'create table customer_snapshot_dump as (select sysdate as SNAPSHOT_DATE,* from customer_snapshot)';
EXECUTE IMMEDIATE 'drop table customer_snapshot purge';
EXECUTE IMMEDIATE
'create table customer_snapshot as (SELECT * FROM customer_dump
UNION
SELECT * FROM customer_snapshot_dump)';
end;
但是 snapshot_date 只会使其合并所有数据。如何在联合中忽略快照日期但仍将其添加到表中?
解决方案
推荐阅读
- asp.net - 如何正确地将脚本添加到 ASP.NET Core 局部视图?
- c# - 如何在我的 azure Web 应用程序机器人上解决 401?
- apache - Rewriterule 从 url 中删除 index.php for codeigniter 导致重定向过多
- android - 仅在特定屏幕中对物理后退按钮按下执行减速器操作以响应本机
- python - TypeError: __init__() 应该返回 None,而不是 'dict'
- excel - Excel 公式可根据多个标准查找进入建筑物的人员的第 1、第 2、第 3 个最小出现次数
- svg - 寻找一种将 SVG/Points 转换为文本(不是 OCR)的方法
- apache-kafka - kafka 是否具备规则引擎的能力?
- html - 无法居中对齐绝对定位thead tr th div的单个div
- wpf - 数据绑定 WPF 从 mysql 数据库 Vb.net 填充组合框