树型数据结构SQL语句的写法
?找出所有的页节点,本例中就是找出所有的普通雇员,使用如下语句:SELECT t2.lname, t2.salary, (SELECT SUM(t1.salary) FROM employee t1 START WITH t1.lname = t2.lname CONNECT BY t1.manager_emp_id = PRIOR t1.emp_id) sum_salary FROM employee t2;????????
SELECT t2.lname, t2.salary, (SELECT SUM(t1.salary) FROM employee t1 START WITH t1.lname = t2.lname CONNECT BY t1.manager_emp_id = PRIOR t1.emp_id) sum_salary FROM employee t2;
?