oracle11g - SQL Query multiple tables same values -


I'm having trouble creating a query

  1. Two tables are company_career and company_people .
  2. People have information related to the person's knowledge (name, address, etc.) and career information (jobs_chittle, department, etc.)
  3. People have been linked to the career by job_ref_ID .
  4. 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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -