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 index?
difference between procedures and function?
why can't we assign not null constraint as table level constraint
two tables are there emp(eno,ename,sal,deptno),dept(deptno,dname).how form the query in deptno,ename,max(sal)
How to get last row id?
sql query to get zero records from a table
The table has 3 columns 4 rows. The output is which column has least null values( A COL SHOULD BE THE OUTPUT) Write the query plz. A B C ---------- 1 NULL 7 2 4 NULL NULL 5 NULL 3 NULL NULL
17. Display the order number and average item cost for each order.
how to code performance tuning of oracle PL/SQL? can any body send me the perfect answer?
Oracle
0 Answers ABC, Genpact, HUI, Oracle,
without using count(*) and rownum how can we count total record in a table
What is sharded cluster?