Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(rating) AS total FROM myoc_review r1 WHERE r1.product_id = p.product_id AND r1.' at line 1
Error No: 1064
SELECT SQL_CACHE p.product_id, (SELECT SQL_CACHE AVG(rating) AS total FROM myoc_review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM myoc_product p LEFT JOIN myoc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN myoc_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN myoc_product_to_category p2c ON (p.product_id = p2c.product_id) INNER JOIN myoc_product_attribute pa1 ON ( pa1.product_id = p.product_id AND pa1.attribute_id = '20' AND pa1.text IN ('Karla')) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (p2c.category_id IN(5006,552,553,550,551,545,546,548,547,544,549,5066,5529,5526,5528,5525,5048,5049,5235,5050,557,538,5523,558,604,5524,559,556,560,5532,561,566,5533,562,5527,563,5667,564,539,5669,5666,5668,565,535,5047,5065,77,542,554,555,543,73,572,74,576,605,573,574,70,575,69,5530,76,582,75,578,579,580,72,5637,581,584,585,71,68,5008,5007)) GROUP BY p.product_id ORDER BY p.sort_order ASC LIMIT 0,16 in /home/gassibco/domains/ on line 69