How to read / make sense this multiple JOINS SQL query properly?

Retiago Drago - Dec 20 '21 - - Dev Community

The query goes like this

SELECT
...
FROM
    A
    RIGHT OUTER JOIN (
        SELECT
            b1,
            b2,
            b3
        FROM
            B
    ) AS BB
    INNER JOIN (
        SELECT
            c1,
            c2,
            c3
        FROM
            C
    ) AS CC ON BB.b1 = CC.c1
    INNER JOIN D ON CC.c2 = D.d2 ON A.a2 = D.d2
Enter fullscreen mode Exit fullscreen mode

That query above returns a table. The problem is the syntax is so weird to me. I can't read and make sense of it the way the writer intended. I didn't even know which table is on which side.

Let's be friend ๐Ÿ‘‹

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .