Binary Tree Nodes

  • + 1 comment

    I copied this query and there was an error to my surprise

    SELECT N, IF(P IS NULL,'Root',IF((SELECT COUNT(*) FROM BST WHERE P=B.N)>0,'Inner','Leaf')) FROM BST AS B ORDER BY N * ERROR at line 1: ORA-00907: missing right parenthesis

    WHY?

    Also P=BST.N is unclear to me.