leaf nodes from a tree choice

From: Totti <saliba.toufic.george_at_gmail.com>
Date: Mon, 14 Jan 2008 16:44:55 -0800 (PST)
Message-ID: <71b69a25-f8e0-46a1-8b11-314f0b198d0e@l32g2000hse.googlegroups.com>

hi all,
i need to produce a report which shows the sum last down level employees and only those
i ve done an attempt which i am posting, but it is giving me weird results(my fault), it is giving me roots also as wel as nodes, something is missed from my querie but i dont know what should it be, to tell sql to go to the deepest level and get me the guy from there;

select "T_P_C", substr(lpad(' ',length(substr("T_P_C",1,12))-5)||m, 1,15) "Sum_$" from
(select sum((assgn_md*job_chg_day)+task_ovhd) m,  task_prj_code as "T_P_C"
 from job, assgn, task
 where assgn.job_code = job.job_code
 and assgn.task_id= task.task_id
 group by task_prj_code
 order by "T_P_C")

  • to me it seems something is missing from the where cluse, but i dont know the concept well, would anyone please help
Received on Mon Jan 14 2008 - 18:44:55 CST

Original text of this message