![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In article <3f41c994$1 (AT) news (DOT) comindico.com.au>, "Alan" <alanpltse (AT) yahoo (DOT) com.au> writes: I have a table contains parent and children information, this is not the actual table that I am working with but has similar structure: ID Name Parent NoOfChildren Age 1 John NULL 3 50 2 Mary 1 0 20 3 Peter 1 0 19 4 David 1 0 30 5 Alan NULL 1 60 6 Candy 5 0 25 7 Bobby NULL 0 35 8 Vincent NULL 0 18 Drop NoOfChildren since it violates normalization. Beg to differ. It might be logically redundant, but, afaik, it does not |
#3
| |||
| |||
|
|
I have a table contains parent and children information, this is not the actual table that I am working with but has similar structure: ID Name Parent NoOfChildren Age 1 John NULL 3 50 2 Mary 1 0 20 3 Peter 1 0 19 4 David 1 0 30 5 Alan NULL 1 60 6 Candy 5 0 25 7 Bobby NULL 0 35 8 Vincent NULL 0 18 Why is Candy not included? She's 25 and has no children. Same with David, 30 and no children. Anyhow, here is one attempt: |
#4
| |||
| |||
|
|
Candy is not included before she is a child of Alan. I only want to include the top level parent. |
![]() |
| Thread Tools | |
| Display Modes | |
| |