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


Please Help Members By Posting Answers For Below Questions

ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process

1741


Explain about integrity constraint?

596


What is object data modeling?

499


Explain an exception and its types?

605


How to select some columns from a table in oracle?

545






How to load excel data sheet to oracle database

582


Explain the use of inctype option in exp command.

590


Can you drop an index associated with a unique or primary key constraint?

579


What are the advantages of oracle?

545


 How to use an oracle sequence generator in a mapping?

556


What is transport network substrate (tns) in oracle?

585


What are the limitations oracle database 10g xe?

566


What are the differences between primary key and unique key?

507


Her departmandaki isçilerden empno' su ikinci sirada olan isçilerin empno, deptno, hiredate, sira_no bigilerini döndüren sorguyu yaziniz?

1561


What are the roles of dba?

608