I am trying to join 4 tables but having issues. my code is listed below.
The error I recieve is
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON advancedcatalog_font_type.id = advancedcatalog_dimensions.font_type_id) LEFT ' at line 6
advancedcatalog_dimensions
id |letter_id | font_type_id | font_size_id | dimensions | LED
----------------------------------------------------------------------------------------------
1 | | | | |
2 | | | | |
3 | | | | |
4 | | | | |
advancedcatalog_font_size
id |font_size |
--------------------------
1 | |
2 | |
3 | |
4 | |
advancedcatalog_font_type
id |font_name |
--------------------------
1 | |
2 | |
3 | |
4 | |
advancedcatalog_letter
id |casing | letter |
------------------------------------------------
1 | | |
2 | | |
3 | | |
4 | | |
Query that works:
SELECT advancedcatalog_letter.letter,
advancedcatalog_dimensions.dimensions,
advancedcatalog_font_type.font_name
FROM (advancedcatalog_dimensions
LEFT JOIN advancedcatalog_letter ON advancedcatalog_dimensions.letter_id = advancedcatalog_letter.id)
LEFT JOIN advancedcatalog_font_type ON advancedcatalog_font_type.id = advancedcatalog_dimensions.font_type_id
LIMIT 0 , 400
Query that does NOT work:
SELECT advancedcatalog_letter.letter,
advancedcatalog_dimensions.dimensions,
advancedcatalog_font_type.font_name
FROM (advancedcatalog_dimensions
LEFT JOIN advancedcatalog_letter ON advancedcatalog_dimensions.letter_id = advancedcatalog_letter.id)
LEFT JOIN (advancedcatalog_font_type ON advancedcatalog_font_type.id = advancedcatalog_dimensions.font_type_id)
LEFT JOIN advancedcatalog_font_size ON advancedcatalog_font_size.id = advancedcatalog_dimensions.font_size_id