case when1 [Hackerrank] Binary Tree Nodes https://www.hackerrank.com/challenges/binary-search-tree-1/problem?isFullScreen=true Binary Tree Nodes | HackerRank Write a query to find the node type of BST ordered by the value of the node. www.hackerrank.com 1. 재귀 CTE 문 이용하기 WITH RECURSIVE TMP AS( SELECT N, P, 1 AS DEPT FROM BST WHERE P IS null UNION ALL SELECT BST.N, BST.P, TMP.DEPT+1 AS DEPT FROM TMP INNER JOIN BST ON TMP.N = BST.P) SELECT.. 2022. 2. 15. 이전 1 다음