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 ('Narvik')) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (p2c.category_id IN(5024,218,219,220,223,224,240,225,280,281,226,227,5539,228,234,229,230,231,232,499,235,221,236,319,222,238,239,241,242,243,244,245,246,247,249,250,251,252,253,713,5534,5535,254,255,5542,256,257,258,260,261,262,263,264,265,266,267,268,269,270,271,272,273,282,274,275,276,277,217,278,279,214,215,216,213,212,317,286,292,300,289,290,298,301,295,318,299,293,287,288,296,297,291,347,303,302,315,304,312,311,307,316,306,305,313,314,309,310,308,285,284,5026,5025)) GROUP BY p.product_id ORDER BY p.sort_order ASC LIMIT 0,16 in /home/gassibco/domains/ on line 69