MySQL Forums
Forum List  »  General

Re: Help - complex joins
Posted by: Peter Brawley
Date: May 29, 2020 01:07PM

If MySQL complains it can't parse `employee`, it's because the From clause aliases that table tblTier3.

If Tier1..2..3..ID values do not map 1:1 ie uniquely to Tier1..2..3Val values, your query will return arbitrary values for Tier1..2..3Val, so your query needs ...

GROUP BY Tier1ID, Tier1Val, Tier2ID, Tier2Val, Tier3ID Tier3Val;

> I can't specify both the AttributionID and the EmployeeID in the same join,

Why not? Let's see the results of ...

Show Create Table answers;

Show Create Table attrib_organization_rl;

Show Create Table attrib_division_rl;

Show Create Table employees;

Show Create Table division;

Show Create Table organization;

> I really need the division to organization and the organization to employee to be left joins too.

Because attrib_organization_rl refers to non-existent employee rows? Better practice would be to clean up the data first.

Options: ReplyQuote


Subject
Written By
Posted
May 27, 2020 01:44PM
Re: Help - complex joins
May 29, 2020 01:07PM
June 02, 2020 10:00AM
June 02, 2020 08:03PM


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.