I need to query for projects and show all accountable employees. I have the following table structure.
---tblProj-----
proj_id > Primary key
project
sample
1 build road
2 replace culvert
---tblEmp-----
emp_id > Primary key
employee
sample
1 Williams
2 Smith
---tblprojemp-----
proj_id > foreign key linked to tblProj.proj_id
emp_id > foreign key linked to tblEmp.emp_id
sample
1 1
1 2
2 2
My problem is that on project 1 Smith and Williams are working on it and on project 2 just Smith. I can query this and get a list of all projects that each employee is working on, but I need help on figuring out how to query for each project and get a list of employees on that project.
how do I get the following results
project responible responsible
build road Williams Smith
replace culvert Smith
rather than
build road Williams
build road Smith
replace culvert Smith
Any help or suggestions would be appreciated if I need to change my structure I am at a point that I still can.
thanks rt
---tblProj-----
proj_id > Primary key
project
sample
1 build road
2 replace culvert
---tblEmp-----
emp_id > Primary key
employee
sample
1 Williams
2 Smith
---tblprojemp-----
proj_id > foreign key linked to tblProj.proj_id
emp_id > foreign key linked to tblEmp.emp_id
sample
1 1
1 2
2 2
My problem is that on project 1 Smith and Williams are working on it and on project 2 just Smith. I can query this and get a list of all projects that each employee is working on, but I need help on figuring out how to query for each project and get a list of employees on that project.
how do I get the following results
project responible responsible
build road Williams Smith
replace culvert Smith
rather than
build road Williams
build road Smith
replace culvert Smith
Any help or suggestions would be appreciated if I need to change my structure I am at a point that I still can.
thanks rt