MySQL Forums
Forum List  »  Newbie

Query between 2 related tables - duplicated records in the result set for every record in the 2nd table that it matches.
Posted by: Panos Stathopoulos
Date: November 02, 2009 07:00AM

Hi from Athens,

I have a db with 3 tables:

table customers
cust_id
name

table charges
charge_id
cust_id
date
amount

table payements
payement_id
cust_id
date
amount


The 3 tables are related on cust_id
table charges and payements are joined on cust_id field.

When i do a query to see the charges and the payements of my clients
the record from the first table is duplicated in the result set for every record in the 2nd table that it matches.

I think that is hapen because records in the first table match more than one record from the 2nd table.

Is there any way to replace the duplicated data by "-"?

Thanks for any help

Options: ReplyQuote


Subject
Written By
Posted
Query between 2 related tables - duplicated records in the result set for every record in the 2nd table that it matches.
November 02, 2009 07:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.