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
How to create a table index?
Difference between varchar and varchar2 data types?
What is a parameter file in oracle?
Why is oracle so popular?
List the types of joins used in writing subqueries?
Why do we use bulk collect in oracle?
How to export your own schema?
how to handle exceptions in post production
normally database take to refresh time 2 hours. but client asked iwant to refresh with in 5 min that same database. do you have any option in BO and Oracle? explain me briefly...kavi
What is Segment Advisor in Oracle?
Explain the use of log option in exp command.
How can you merge two tables in oracle?
How to declare a local variable?
Use of an integrity constraint is better to validate data. Explain
How to execute a stored program unit?