1064
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 'GROUP BY node.id ORDER BY node.l' at line 1
SELECT node.id, node.l, node.r, (COUNT(parent.id) - 1) AS depth FROM skvlinz_categorys_tree AS node, skvlinz_categorys_tree AS parent WHERE node.l BETWEEN parent.l AND parent.r AND node.id = GROUP BY node.id ORDER BY node.l