Is there an easy way to join more than 3 tables in MySQL without resorting to the nested Left join? I'm trying to join ~ 20 tables and the syntax I'm thinking about using is:
SELECT a.Col1, b.Col2, c.Col3, d.Col4
FROM Tbl1 AS a
LEFT JOIN Tbl2 AS b
ON a.Col1 = b.Col2
LEFT JOIN Tbl3 AS c
ON a.Col1 = c.Col3
LEFT JOIN Tbl4 AD d
ON a.Col1 = d.Col4;
My only stipulation is that even if the tables b, c, d don't have rows that are in a, they get set to null (I'm under the impression this is cool with the left join setting A to the master). Is there a better way, or is this the best way?
Thanks in advance.
SELECT a.Col1, b.Col2, c.Col3, d.Col4
FROM Tbl1 AS a
LEFT JOIN Tbl2 AS b
ON a.Col1 = b.Col2
LEFT JOIN Tbl3 AS c
ON a.Col1 = c.Col3
LEFT JOIN Tbl4 AD d
ON a.Col1 = d.Col4;
My only stipulation is that even if the tables b, c, d don't have rows that are in a, they get set to null (I'm under the impression this is cool with the left join setting A to the master). Is there a better way, or is this the best way?
Thanks in advance.