CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Mysql Join dilemna

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 02/29/2008, 10:54 AM

Ok. I have two tables:

'Classlist'= student_id, firstname, lastname, family_id

"Reimbursement' = reimb_family_id, amount.

I need to do a join on the tables where it will connect the familyid's from both fields and return with the last_name from the classlist table.

But every join I have tried brings back more than one result.. cause there are multiple students in every family.
What is the modifier I a missing?



_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
datadoit
Posted: 02/29/2008, 11:40 AM

How about:

SELECT DISTINCT(family_id) AS family_id, lastname
FROM Classlist INNER JOIN Reimbursement
ON (Classlist.family_id = Reimbursement.reimb_family_id)
GROUP BY family_id
ORDER BY lastname
ckroon

Posts: 869
Posted: 02/29/2008, 12:53 PM

That did it.
:-D
Thank you
_________________
Walter Kempees...you are dearly missed.
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.