[ClickHouseDB\Exception\DatabaseException] Syntax error: failed at position 208: GROUP BY R.ItemID HAVING sum(R.Sign) > 0 UNION ALL ( SELECT ItemID,Rating,CityID FROM ( SELECT RC.ItemID, sum(RC.Rating * RC.Sign) AS Rating, any(CityID) as Ci. Expected non-empty parenthesized list of expressions IN:SELECT COUNT(*) AS Cnt, MIN(Price) as MinPrice, MAX(Price) as MaxPrice FROM ( SELECT R.ItemID, sum(R.Rating * R.Sign) AS Rating, any(CityID) as CityID FROM rate_v1 R WHERE R.CityID=243 AND R.SectionID IN () GROUP BY R.ItemID HAVING sum(R.Sign) > 0 UNION ALL ( SELECT ItemID,Rating,CityID FROM ( SELECT RC.ItemID, sum(RC.Rating * RC.Sign) AS Rating, any(CityID) as CityID FROM rate_v1 RC WHERE RC.CityID=0 AND RC.SectionID IN () GROUP BY RC.ItemID HAVING sum(RC.Sign) > 0 ) ANY LEFT JOIN ( SELECT R.ItemID as ItemID, sum(R.Rating * R.Sign) AS Rating2, any(CityID) as CityID2 FROM rate_v1 R WHERE R.CityID=243 AND R.SectionID IN () GROUP BY R.ItemID HAVING sum(R.Sign) > 0 ) USING ItemID WHERE Rating2 = 0 ) ) ANY INNER JOIN ( SELECT * FROM items WHERE SectionID IN () ) USING ItemID FORMAT JSON (62) /data/web/local/php_interface/lib/phpClickHouse/src/Statement.php:170 #0: ClickHouseDB\Statement->error() /data/web/local/php_interface/lib/phpClickHouse/src/Statement.php:202 #1: ClickHouseDB\Statement->check() /data/web/local/php_interface/lib/phpClickHouse/src/Statement.php:219 #2: ClickHouseDB\Statement->init() /data/web/local/php_interface/lib/phpClickHouse/src/Statement.php:529 #3: ClickHouseDB\Statement->rows() /data/web/bitrix/php_interface/lib/Regmarkets/CSection.php:187 #4: Pdev\Regmarkets\CSection->getData(string) /data/web/bitrix/templates/goods_yandex_ver_6/components/bitrix/catalog/category/regmarkets_section_v2.php:26 #5: include(string) /data/web/bitrix/templates/goods_yandex_ver_6/components/bitrix/catalog/category/section.php:331 #6: include(string) /data/web/bitrix/modules/main/classes/general/component_template.php:535 #7: CBitrixComponentTemplate->__IncludePHPTemplate(array, array, string) /data/web/bitrix/modules/main/classes/general/component_template.php:618 #8: CBitrixComponentTemplate->IncludeTemplate(array) /data/web/bitrix/modules/main/classes/general/component.php:657 #9: CBitrixComponent->showComponentTemplate() /data/web/bitrix/modules/main/classes/general/component.php:605 #10: CBitrixComponent->includeComponentTemplate(string) /data/web/bitrix/components/bitrix/catalog/component.php:135 #11: include(string) /data/web/bitrix/modules/main/classes/general/component.php:535 #12: CBitrixComponent->__includeComponent() /data/web/bitrix/modules/main/classes/general/component.php:578 #13: CBitrixComponent->includeComponent(string, array, boolean) /data/web/bitrix/modules/main/classes/general/main.php:1012 #14: CAllMain->IncludeComponent(string, string, array, boolean) /data/web/index.php:304 #15: include_once(string) /data/web/bitrix/modules/main/include/urlrewrite.php:154 #16: include_once(string) /data/web/bitrix/urlrewrite.php:2