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 ('Kansas')) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (p2c.category_id IN(5015,1000,1001,1030,1017,999,1003,1002,834,837,836,835,859,860,855,856,857,858,805,806,875,876,878,883,881,882,877,5597,880,5648,5647,5218,5220,5221,5222,5079,5080,5615,5617,5616,5614,5203,5200,5204,5202,5201,5205,5603,5605,5607,5606,5604,865,864,5611,5612,5610,794,795,796,845,844,846,847,848,842,841,840,843,5654,5655,5653,5215,5216,5217,812,813,814,815,5224,5225,5566,5226,5075,5076,5077,5078,5081,5072,5073,5051,786,5608,5074,767,5223,768,769,787,788,770,771,5206,5652,790,772,861,791,792,838,839,1036,849,850,862,793,5609,863,797,5602,5199,866,798,867,868,5613,851,852,869,5210,870,871,872,803,804,853,873,854,833,874,748,749,764,746,745,743,742,737,736,738,732,733,729,730,5198,5197,5153,5154,5155,5156,716,717,5152,718,719,720,721,722,723,724,725,726,5040,727,5219,728,731,734,735,739,740,5568,741,5227,744,747,766,765,991,992,993,990,968,5082,969,5083,960,962,959,961,5569,5570,5571,5572,971,945,953,972,5228,955,973,5194,958,963,964,965,967,988,989,994,5585,5584,5582,5573,5574,951,952,948,949,947,5601,5600,944,5598,946,950,5591,954,5193,5195,956,957,5196,966,976,970,942,5583,943,1033,1034,1035,1021,1022,1023,1024,1025,1027,1020,1028,1019,1032,924,925,921,922,5640,923,915,916,1041,1042,929,5579,5577,917,911,912,913,914,5578,918,919,5557,5558,907,906,900,902,905,899,5544,903,904,5639,901,896,897,908,5580,895,898,909,5567,910,920,5643,5576,5644,5575,884,885,886,5035,888,891,889,1043,890,887,5191,892,977,978,987,980,983,984,985,986,169,166,164,165,163,168,157,162,167,762,763,753,1026,750,926,757,756,5085,819,758,820,830,751,831,1031,5581,974,759,1018,927,752,760,754,5192,755,995,996,894,761,930,998,931,832,1029,1004,5017,5016)) GROUP BY p.product_id ORDER BY p.sort_order ASC LIMIT 0,16 in /home/gassibco/domains/domstyle.com.ua/public_html/system/database/mysql.php on line 69