MySQL Forums
Forum List  »  Newbie

Re: Query Assistance - Many to Many Join
Posted by: Phillip Ward
Date: October 20, 2016 05:02AM

Quote

All the source data is populated into a master table, with multiple rows being created for each record.

JOIN
db.outletdata OUTL
ON SEG.record_number = OUTL.record_number

But if you have multiple "lines" for each "record", then joining on this one field will give you duplication which, I suspect, is what you're seeing.

It also suggests that your data is not properly normalised.

Start by cutting your query down so that it only uses two tables (or the same table twice), but select everything from both.
That should show you the duplicated values that are giving you the trouble.

Then, as others have already asked, show us your table structures and some sample data so that we can recreate and, hopefully, help you solve the problem.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Query Assistance - Many to Many Join
October 20, 2016 05:02AM


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.