SQL Language (MOSC)

MOSC Banner

Concatenate all records from two tables in the specified hierarchy

edited Jun 27, 2023 10:43AM in SQL Language (MOSC) 1 comment

Hi all,

Please can someone help, this is the query below. I need to combine the results two tables in the specified hierarchy

Oracle DB version 12c Enterprise Edition Release 12.2.0.1.0


SELECT company_id,
         user_id,
         module_id,
         menu_id,
         menu_desc_spacing,
         view_record,
         Add_record,
         Modify_record,
         DELETE_RECORD,
         post_record,
         print_record,
         Approval,
         confidential,
         Approval_level
  FROM ( SELECT company_id,
         user_id,
         module_id,
         menu_id,
         menu_desc_spacing,
         view_record,
         Add_record,
         Modify_record,
         DELETE_RECORD,
         post_record,
         print_record,
         Approval,
         confidential,
         Approval_level
      FROM user_access_rights 
      union all
     SELECT company_id,
         NULL ,   
         module_id,
         module_id menu_id,
         module_name menu_desc_spacing,
         view_record,
         Add_record,
         Modify_record,
         DELETE_RECORD,
         post_record,
         NULL,   
         NULL,
         confidential,
         NULL   Approval_level
      FROM module_access) where user_id ='SUPER' 

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center