timtodd
Posts: 4
|
| Posted: 05/03/2007, 6:48 AM |
|
Ok.. THis may be a stupid question but I can't wrap my head around this:
I have three table from which im trying to pull a report from.. they are:
-person (id, firstname, lastname, person_phone, email, person_address, department_id)
-department (id, department_name, department_phone, deptartment_address)
-department_comments (id, comment, department_id)
THe report should work like this----
-------------------------------------------------------------
{department name}
{deprtmant address}
{department phone}
------------------------------------------------------------
{department comments}
-------------------------------------------------------------
{lastname}, {firstname}
{person_phone}
{person_address}
{email}
--------------------------------------------------------------
THe problem I am having is if I join the person to departments using department_id, as well as department comments, I am getting duplicate person entries for each department comment...
Here is my sql:
SELECT *
FROM (department INNER JOIN person ON
department.id = person.department_id) INNER JOIN department_comments ON
department.id = department_comments.department_id
What am I doing wrong?
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 05/03/2007, 4:03 PM |
|
timtodd
What database and database version are you using??
|
 |
 |
|