Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Help 1

Status
Not open for further replies.

hubcap1324

IS-IT--Management
Aug 12, 2003
60
US
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....
 
Extremely helpful. Many thanks as I got it to work beautifully!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top