We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Binary Tree Nodes
You are viewing a single comment's thread. Return to all comments →
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.