1 2 Previous Next 17 Replies Latest reply on Jun 5, 2018 4:21 PM by Christian Berg

    Implement self-join in the repository






      We have a table which contains Work Orders and Project Numbers in the same table (like a manager and employee relationship).  A project is made up of 1 or many Work Orders.


      Here is some sample data.


      Whenever I want WO data with Project Number info with it, I use the below query.


      select w.wo_id, w.wo_num, w.wo_desc, p.wo_num as proj_num, p.wo_desc as proj_desc, p.wo_id proj_id
      from work_orders w, work_orders p
      where w.proj_id = p.wo_id
      and w.proj_ind = 0;


      While building my repository, I created a view for the above query and imported it.  I also imported the WORK_ORDERS table and then created a join between the view and WORK_ORDERS table on the WO_ID -> PROJ_ID key.


      Is there a better way to implement these self join type data in OBI repository?



        1 2 Previous Next