Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 24, 2012 09:06 AM by -_-
Member
375 Points
1033 Posts
Jul 06, 2012 06:58 AM|LINK
anyone know what is the meaning of "start with" and "connect by", i have read some example for this term. but don't know how to use.
any simple example and explanation for me about pl/sql start with function? it seens relate to tree and node relationship.
All-Star
15346 Points
3142 Posts
Jul 06, 2012 01:20 PM|LINK
please check
http://www.adp-gmbh.ch/ora/sql/connect_by.html
Contributor
3744 Points
731 Posts
Jul 06, 2012 11:31 PM|LINK
used for hierarchical queries
236 Points
37 Posts
Jul 12, 2012 11:21 AM|LINK
The "START WITH...CONNECTED BY" clause is used to select the data that has a hierarchical relattionship.
For Example :
Table1 (Table name)
id Reporting_id
A1 A
A2 A
A11 A1
A12 A2
B1 B
If u Select the details for Reporting_id = "A"
without Start with
Select * from Table1 where Reporting_id ="A"
Ans
-----
Using Strat with
Select * from Table1 START WITH Reporting_id ="A"
CONNECT BY id=Reporting_id;
Jul 24, 2012 09:06 AM|LINK
softanalyst The "START WITH...CONNECTED BY" clause is used to select the data that has a hierarchical relattionship. For Example : Table1 (Table name) id Reporting_id A1 A A2 A A11 A1 A12 A2 B1 B If u Select the details for Reporting_id = "A" without Start with Select * from Table1 where Reporting_id ="A" Ans ----- id Reporting_id A1 A A2 A Using Strat with Select * from Table1 START WITH Reporting_id ="A" CONNECT BY id=Reporting_id; Ans ----- id Reporting_id A1 A A2 A A11 A1 A12 A2
i would like to ask why my result list has many duplicate record and result not same as yours??
table A
id parent_id
A null
B A
i just select * from A where id='A' connect by piror id=parent_id
result as belows:
-_-
Member
375 Points
1033 Posts
pl/sql "start with" function
Jul 06, 2012 06:58 AM|LINK
anyone know what is the meaning of "start with" and "connect by", i have read some example for this term. but don't know how to use.
any simple example and explanation for me about pl/sql start with function? it seens relate to tree and node relationship.
Mudasir.Khan
All-Star
15346 Points
3142 Posts
Re: pl/sql "start with" function
Jul 06, 2012 01:20 PM|LINK
please check
http://www.adp-gmbh.ch/ora/sql/connect_by.html
Lannie
Contributor
3744 Points
731 Posts
Re: pl/sql "start with" function
Jul 06, 2012 11:31 PM|LINK
used for hierarchical queries
softanalyst
Member
236 Points
37 Posts
Re: pl/sql "start with" function
Jul 12, 2012 11:21 AM|LINK
The "START WITH...CONNECTED BY" clause is used to select the data that has a hierarchical relattionship.
For Example :
Table1 (Table name)
id Reporting_id
A1 A
A2 A
A11 A1
A12 A2
B1 B
If u Select the details for Reporting_id = "A"
without Start with
Select * from Table1 where Reporting_id ="A"
Ans
-----
id Reporting_id
A1 A
A2 A
Using Strat with
Select * from Table1 START WITH Reporting_id ="A"
CONNECT BY id=Reporting_id;
Ans
-----
id Reporting_id
A1 A
A2 A
A11 A1
A12 A2
-_-
Member
375 Points
1033 Posts
Re: pl/sql "start with" function
Jul 24, 2012 09:06 AM|LINK
i would like to ask why my result list has many duplicate record and result not same as yours??
table A
id parent_id
A null
B A
i just select * from A where id='A' connect by piror id=parent_id
result as belows:
A null
A null