Top Competitors

  • + 0 comments
    1. Yes, you're right that it is redundant.

    2. The order of joins is flexible, but some of the ON id-matching constraints refer to previous joins. So if you're referring to any of them then they do have to be in the order that they're declared/called.

    Here is an alternate way to do this sort of joining. It makes more sense to me and eliminates a bit of the INNER JOIN repetition.

    FROM        Hackers             H
    JOIN       (Submissions as      S,
                            Challenges as       C, 
                            Difficulty as       D)
            ON     (S.Hacker_ID = H.hacker_ID
                    AND S.Challenge_ID = C.Challenge_ID
                    AND C.Difficulty_Level = D.Difficulty_Level)