查询以获取BI发布者中参数的工作表管理器层次结构

时间:2018-08-16 09:54:15

标签: sql bi-publisher

该参数具有两个值:直接报告和间接报告。

我尝试过:

 select distinct cch.emp_person_id,
        cch.lvl_num Empl_Lvl,
        cch_lv.lvl_num MGR_LVL
 from cmp_cwb_hrchy cch, cmp_cwb_hrchy cch_lv
 where cch.mgr_person_id = :Mgr_id and
       cch_lv.emp_person_id = :Mgr_id and
       cch.MGR_PERSON_EVENT_ID= cch_lv.MGR_PERSON_EVENT_ID and 
       cch.EMP_PERSON_EVENT_ID = cch_lv.EMP_PERSON_EVENT_ID and
       cch.lvl_num = cch_lv.lvl_num and
       ( 1=1 and cch.lvl_num = case when :direct_ALL = 'Direct' then cch_lv.lvl_num+1 else NULL end) and
       ( 1=1 and cch.lvl_num > case when :direct_ALL = 'ALL' then cch_.lvl_num else NULL end) 

0 个答案:

没有答案