Ошибка (databaseException): 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 ') and oc_opt.obj_id = h.obj_id and coalesce(oc_opt.int_val, 0) > 0 limit 0, 1) >' at line 8 in query: Select SQL_CALC_FOUND_ROWS h.id, (case when (Select coalesce(oc_amount.int_val, 0) From cms3_object_content oc_amount Where oc_amount.field_id = 302 and oc_amount.obj_id = h.obj_id limit 0, 1) > 0 then 2 when (Select coalesce(oc_in_stock.int_val, 0) From cms3_object_content oc_in_stock Where oc_in_stock.field_id = 573 and oc_in_stock.obj_id = h.obj_id limit 0, 1) > 0 then 2 when (Select sum(coalesce(oc_opt.int_val, 0)) From cms3_object_content oc_opt Where oc_opt.field_id in() and oc_opt.obj_id = h.obj_id and coalesce(oc_opt.int_val, 0) > 0 limit 0, 1) > 0 then 2 when (Select coalesce(oc_pre_ord.int_val, 0) From cms3_object_content oc_pre_ord Where oc_pre_ord.field_id = 605 and oc_pre_ord.obj_id = h.obj_id limit 0, 1) > 0 then 1 else 0 end) as amount From cms3_hierarchy_relations hr, cms3_hierarchy h Where hr.rel_id = 352 and hr.child_id = h.id and h.type_id = 56 and h.is_active = 1 and h.is_deleted = 0 order by amount desc, h.ord desc, h.id asc limit 0, 100

Показать отладочную информацию