CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Multiple Join Problem

Print topic Send  topic

Author Message
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?
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 05/03/2007, 4:03 PM

timtodd
What database and database version are you using??
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.