如何在obiee中结合两个表?

时间:2013-02-26 09:31:47

标签: union obiee

我的物理层有两个表(由于某种原因)虽然我知道它更好两个联合两个表。表A和表B具有相同的结构。我的目标是实现一个像:

select F1,F2 
     from (select *
           from tableA
           union
           select *
           from tableB)
tableMix

只需联合两个因子表...如何在管理工具中执行此操作?

现在像那样的nqquery

WITH SAWITH0 AS
    ((select T3580.AMOUNT as c1, T30887.YEAR_DESC as c2, T30887.YEAR_WID as c3
      from DW_DAY_D T30887 /* A_Dim_DW_TQ_DAY_D */, DW_TQ_PRODUCT_F T3580 /*                    A_Fact_DW_TQ_PRODUCT_F */
      where (T3580.DAY_ID = T30887.DAY_WID)
      union all
      select T120596.AMOUNT   as c1,
      T30887.YEAR_DESC as c2,
      T30887.YEAR_WID  as c3
      from DW_DAY_D T30887 /* A_Dim_DW_TQ_DAY_D */, DW_MHG_PRODUCT_F T120596 /*      A_Fact_DW_MHG_PRODUCT_F */
      where (T30887.DAY_WID = T120596.DAY_ID))),
      SAWITH1 AS
     (select distinct D3.c1 as c1, D3.c2 as c2, D3.c3 as c3 from SAWITH0 D3)
     select distinct 0 as c1, D2.c2 as c2, D2.c1 as c3, D2.c3 as c4
     from SAWITH1 D2
     order by c4, c3

但是我无法将“协议”规则设置为“金额”上的“总和”。

1 个答案:

答案 0 :(得分:0)

选项1: 您可以在物理层中创建不透明视图。该视图将在您的帖子中提到您的查询。

选项2: 在BMM层中,使用两个逻辑表源(tableA和tableB)创建逻辑表(tableMix)。