Tuesday, January 4, 2011

"connect by prior" in Oracle

For eg.

SELECT employee_id, last_name, manager_id
FROM employees
CONNECT BY PRIOR employee_id = manager_id;

A condition that identifies the relationship between parent rows and child rows of the hierarchy.