暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 带行存档的外部连接

askTom 2018-09-27
171

问题描述


LiveSQL-链接:https://livesql.oracle.com/apex/livesql/s/hblhxmq40jtini45sivyqj4le

create table test_table (id number(10),name varchar2(10)) row archival;

insert into test_table (id,name) values (1,'name1');
insert into test_table (id,name) values (2,'name2');
insert into test_table (id,name) values (3,'name3');
insert into test_table (id,name) values (4,'name4');
commit;

select * from test_table;

update test_table set ora_archive_state = 1 where id = 1;
commit;


select * from test_table where id = 1; /* no data found -> correct*/

select * from test_table t left join test_table t1 on (t.id = t1.id) where t.id = 1; /* 1 row found -> incorrect*/

select * from test_table t join test_table t1 on t.id = t1.id and t.id = 1;/* no data found -> correct */
复制



你好,汤姆,

我有点小问题。我使用数据库中的行存档,并希望隐藏一些数据,因为它不再相关。不应因为存档政策而将其删除。但是,如果我选择具有normal select或inner join的数据,则不会选择存档的数据。

如果我使用左或右连接,我变成比我想要的更多的数据 (已经存档的行)

我没有找到关于使用行存档连接的文档。

是bug还是功能?

我可以配置它来隐藏存档的行吗?

亲切的问候

叶夫根尼·戈林

专家解答

这是一个错误 (27555481: 使用外部连接条件的行存档选项的错误结果)。在Linux上有一个可用于12.1的补丁。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论