使用连接执行联合而不是联合ALL

时间:2016-01-13 12:51:04

标签: sql join cloud union informatica

我们有一个要求,在我们尝试使用informatica cloud为2个不同数据库的表执行联合操作时,我们没有联合转换。那么试着探索是否可以使用左/全外连接来执行此操作?

Subject<Integer, Integer> source = PublishSubject.<Integer>create().toSerialized();

ConnectableObservable<Integer> co = source.sample(
    500, TimeUnit.MILLISECONDS, Schedulers.io())
.onBackpressureBuffer().publish();

co.subscribe(yourSubscriber);
co.connect();

source.onNext(1);

注意:Not Union ALL only Union

1 个答案:

答案 0 :(得分:1)

unionunion all之间的区别仅仅是删除不同的值。您的问题的答案是,您可以使用一堆union语句,coalesce()select distinct模仿full join

然而,为什么不这样做:

select *
from t join
     p
     on t.id in (p.id, p.id2);

根据数据的不同,您可能需要select distinct

select distinct *
from t join
     p
     on t.id in (p.id, p.id2);
相关问题