Hi All,
I am trying to understand CONNECT BY Level/prior/root. But i find it difficult to decipher what it actually does. I believe this is very useful method provided by oracle and can have multiple usages. can anyone please help me on this.
I googled about it but everywhere i could find only employee and manager problem, which will be solved by below query.
SELECT employee_id, last_name, manager_id
FROM employees
CONNECT BY PRIOR employee_id = manager_id;
But if we just want query like below we can get the employee and its manage without CONNECT BY .
SELECT employee_id, last_name, manager_id
FROM employees;
Other query is got for connect by is below, but couldn't understand it also:
select SYSDATE-41 + level - 1 the_date
from dual
connect by level <= SYSDATE - SYSDATE-41 + 1
Please help me .
Edited by: J2EE_Life on Dec 6, 2011 8:12 AM