SELECT P1.* FROM struktura_en AS P1, struktura_en AS P2 WHERE P1.lft BETWEEN P2.lft AND P2.rgt AND P2.cat_id != 1 AND P1.cat_id != AND P2.cat_id = ORDER BY P1.lft [nativecode=ERROR: syntax error at or near "ORDER" LINE 1: ...P2.cat_id != 1 AND P1.cat_id != AND P2.cat_id = ORDER BY P... ^]