rookiecoder
11-13-2009, 03:40 AM
Hi,
I have the following tables structure
employee
id (Primary)
contract_id
location_id
rank (enum field)
contract
id (Primary)
location_id
rank (enum field...same as that of employee)
rank_name
name (corresponding name to each rank)
rank (enum field...same as that of employee)
location
id (Primary)
location_name
So now I want to retrieve the following details of an employee given his id
- rank_name.name from the employee.rank as well as contract.rank
- location.location_name from the employee.location_id as well as contract.location.id
i.e I need the four above mentioned fields
How will I go about doing this in one select query? Or is it not possible?
I have the following tables structure
employee
id (Primary)
contract_id
location_id
rank (enum field)
contract
id (Primary)
location_id
rank (enum field...same as that of employee)
rank_name
name (corresponding name to each rank)
rank (enum field...same as that of employee)
location
id (Primary)
location_name
So now I want to retrieve the following details of an employee given his id
- rank_name.name from the employee.rank as well as contract.rank
- location.location_name from the employee.location_id as well as contract.location.id
i.e I need the four above mentioned fields
How will I go about doing this in one select query? Or is it not possible?