oracle11g - SQL Query multiple tables same values -
I'm having trouble creating a query
- Two tables are company_career and company_people .
- People have information related to the person's knowledge (name, address, etc.) and career information (jobs_chittle, department, etc.)
- People have been linked to the career by job_ref_ID .
- The Career table contains Direct_Reports_ID and has a unique ID that is affiliated with job_arr_id
Example: job_ref_id = '1' result in direct_report_id = 'A' I then use the value produced from direct-report_id (i.e., 'A') and ask job_ref_ID = 'A' and it produces the name of the employee. Since it generates the employee's name (which is actually a manager) I will need to know how to present it as a manager name.
I think I know what you are looking for, just join you and use nicknames For example:
SELECT cp.name AS [EmployeeName], cp.address AS [EmployeeAddress], cc.job_title as [employeeTitle], cc.department as [employee] From the company name [Manager name] join the company people except CP and c_cjob_ref_id cp.job_ref_id cp.job_ref_id left join company_people m at m.job_ref_id = cc.direct_report_id
Comments
Post a Comment