hubcap1324
IS-IT--Management
Ok I am fairly new to SQL language and need some help with what looks like a simple query. All of the records are in one table so it should be straightforward but I am hung up on how to get one of the needed columns.
Table name is persnl
Columns are persnl_id, mgr_id, job_type, per_dob, first_name, last_name
I need to pull two job_types: accttmps and prodtmps listing their names, dob and the employee's mgr name. Their is not a separate mgr name field as the manager names are in with the rest of the employees.
SELECT first_name, last_name, per_dob
FROM persnl
WHERE persnl_id LIKE 'accttmps'
OR persnl_id LIKE 'prodttmps'
My issue is how I get the manager name from this? The mgr_id field lists the manager id for that particular employee so I somehow need to take that mgr_id and reference it back to the managers persnl_id to get their name. I just cannot figure that part out....
I appreciate any help on this....
Table name is persnl
Columns are persnl_id, mgr_id, job_type, per_dob, first_name, last_name
I need to pull two job_types: accttmps and prodtmps listing their names, dob and the employee's mgr name. Their is not a separate mgr name field as the manager names are in with the rest of the employees.
SELECT first_name, last_name, per_dob
FROM persnl
WHERE persnl_id LIKE 'accttmps'
OR persnl_id LIKE 'prodttmps'
My issue is how I get the manager name from this? The mgr_id field lists the manager id for that particular employee so I somehow need to take that mgr_id and reference it back to the managers persnl_id to get their name. I just cannot figure that part out....
I appreciate any help on this....