I am trying to create a hierarchy of units in the organization. I have 2 tables unit table and unit_hierarchy table (attached). From these tables I need to extract data to a third table called hierarchy_temp. The hierarchy_temp table is a perfect hierarchy order. I found a copy of the hierarchy_table table (attached) but do not know how it was created.