pls explain connect by prior with example and its real time
use
Answer Posted / anil kumar karasi
sql>Select rownum,rownid,level,empno,ename from emp
connect by prior empno=mgr where mgr is null;
o/p
Rownum Rowid Level empno ename
------ ----- ----- ----- -----
1 AABBBCCDA 1 5678 abcd
2 AABBBCCDB 1 9087 poiu
3 AABBBCCDC 2 8567 QWER
4 AABBBCCDD 2 7321 LKJH
5 AABBBCCDE 3 1284 ZXCV
For more details go through this link
http://www.psoug.org/reference/connectby.html
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
Is rowid unique in oracle?
What is oracle data type?
What is a lookup table in oracle?
What is Data Dictionary Cache in Oracle?
How to open and close an explicit cursor in oracle?
How to create additional tablespaces for an new database?
What are the attributes of the cursor?
What are the system predefined user roles?
How does one get the view definition of fixed views/tables?
How to insert a new row into a table in oracle?
Can objects of the same schema reside in different tablespace?
Can multiple cursors being opened at the same time?
What is the best way to do multi-row insert in oracle?
How to load a large xml file?
How to drop an existing table in oracle?