An Error Was Encountered
Error Number: 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 'AND tertiary_2.table_group = 'collection' WHERE catalogue.slug = 'holy-communion' at line 4
SELECT catalogue.title as product_title, catalogue.id, catalogue.description_html as product_description, catalogue.price as product_price, catalogue.date_year as product_date FROM (`catalogue`) INNER JOIN `tertiary` as tertiary_1 ON tertiary_1.primary_id = catalogue.id AND tertiary_1.category_id = 4 AND tertiary_1.table_group = 'category' INNER JOIN `tertiary` as tertiary_2 ON tertiary_2.primary_id = catalogue.id AND tertiary_2.category_id = AND tertiary_2.table_group = 'collection' WHERE catalogue.slug = 'holy-communion-set' AND catalogue.archived = 'no' ORDER BY tertiary_1.rank DESC, tertiary_2.rank DESC