Quote:
Originally Posted by qw12er
Basicaly I need to fetch the root parent of any object child. (could be as low as 25 level deep into the tree structure.)
Is there a way to do it in mysql ? I've seen it in SQLServer with the "With" statement.
heres my db columns:
dbID idParent idChild
1 2
1 3
2 4
2 5
4 6
For example, I need to query to return 1 if I look for idChild = 6
thanks
|
Can't tell what you're trying to accomplish with that table. Seems to be missing data.
Regardless, it sounds like you real problem is that the DB design sucks and you'd just have to do multiple queries..