Byte My Data

A personal collection of advice and solutions I've used.

About the author

Something about the author

Recursive query in Oracle using CONNECT BY clause

This page explains the hierarchical query using the (start with) connect by clause in an Oracle SQL Query.

http://www.oradev.com/connect_by.jsp

SELECT LPAD(' ', 2*level-1)|| SYS_CONNECT_BY_PATH(last_name, '/') "Path" 
FROM employees 
CONNECT BY PRIOR employee_id = manager_id

See also: http://www.orafaq.com/node/2038


Permalink | Comments (0) | Post RSSRSS comment feed

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading