SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to get all Childs and subchilds of a parent


How to get all Childs and subchilds of a parent

Author
Message
anilkumar04_b
anilkumar04_b
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 9
Hi All,

I need an urgent help to build some logic in Oracle DB.

I have a table called TREE and in that we have data based on hierarchies.
We have columns like DataID and ParentID and DataID column is unique one.

And the data for DataID and ParentID will be this is like parent and child relation ship.
I need to get the count of all DataID's and Sub-dataID's of ParentID.

I need to get the count of this without using Start With connect by option.

Is there a way to get this done...

Thanks
Anilkumar B
Sean Lange
Sean Lange
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59348 Visits: 17947
anilkumar04_b (2/13/2013)
Hi All,

I need an urgent help to build some logic in Oracle DB.

I have a table called TREE and in that we have data based on hierarchies.
We have columns like DataID and ParentID and DataID column is unique one.

And the data for DataID and ParentID will be this is like parent and child relation ship.
I need to get the count of all DataID's and Sub-dataID's of ParentID.

I need to get the count of this without using Start With connect by option.

Is there a way to get this done...

Thanks
Anilkumar B


Welcome to SSC. There is no way we can help with the limited amount of information you have posted. We would need to see ddl (create table scripts) and sample data (insert statements) in addition to desired output. Please take a few minutes to read the article found at the first link in my signature for best practices when posting questions.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search