pls explain connect by prior with example and its real time
use
Answers were Sorted based on User's Feedback
Answer / 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 |
Connect by prior can be used to create heirarchical tree
structure
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / simi
CONNECT BY PRIOR is used for tree-structured queries.
I found a simple & useful explanation here:
http://www.oraclepassport.com
SQL - CONNECT By PRIOR Section
Is This Answer Correct ? | 4 Yes | 2 No |
What is autonomous transaction?
How to call a trigger inside a stored procedure?Give an example.
what is the difference between restoring and recovering?
what is shell?
What is dictionary cache ?
What is concurrency in oracle?
how to create a new database in oracle?
Can we create database in oracle using command line ?
Explain what are the type of synonyms?
write a query to count number of alphabets in given string for example "APPLE" write a query to generate sequence from 50 to 100 write a query to display in single string "ABCD,EFGH,IJKL,PQRS"
Can we call procedure inside function in oracle?
10)In an RDBMS, the information content of a table does not depend on the order of the rows and columns. Is this statement Correct? A)Yes B)No C)Depends on the data being stored D)Only for 2-dimensional tables