这里用到了Oracle的一个树形结构查询函数select * from record START WITH A.TREE_NODE IN ('COST_CTR_10053')CONNECT BY PRIOR A.TREE_NODE_NUM = A.PARENT_NODE_NUM.查出指定节点下的所以子节点然后连接leaf表,选出所有的叶子. /* Formatted on 11/7/2015 11:05:57 PM (QP5 v5.267.14150.38573) */SELECT B.RAN
Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes.