SELECT gt.position_id, gt.city_id, gt.caption, gt.seo_url, gt.parent_position_id parent_id, gt.cnt count, gt.group_id, gt.subgroup_id, section_id, 'RDO' node_type
FROM ps_group_tree gt
WHERE gt.parent_position_id = and not(gt.group_id=196 and gt.subgroup_id=1)
ORDER BY gt.sort_index You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and not(gt.group_id=196 and gt.subgroup_id=1)
ORDER BY gt.' at line 3 in query