|
|
Archives of the TeradataForum
Message Posted: Wed, 26 Oct 2005 @ 15:55:18 GMT
Subj: | | Recursive Queries and conditioning hierarchies |
|
From: | | Lefeld, Dennis |
All,
I am trying to select specific hierarchies for removal. At this point stored procedures are not recommended due to CPU consumption, and I
would like to perform this in one SQL pass. It seems like the only potential option is recursive queries. The problem, I think, is that I cannot
selectively choose a hierarchy without limiting the result set to a partial list of the hierarchy that I wish to remove. Below is a list of the
sample data. I would like to remove the hierarchy starting at ID 1. Everytime I try condition the recursive query I just get the one record with
the ID of 1 instead of 1,2,3 and 4. Any help would be appreciated.
ID Parent_ID
1 NULL
2 1
3 2
4 1
5 NULL
6 5
7 NULL
Dennis
| |