+3  A: 

There isn't a way to achieve this directly in standard SQL. Oracle has the "start with", "connect by" syntax and that supports it through "level".

Alternatively, if you can remodel your data you could instead use nested sets: http://en.wikipedia.org/wiki/Nested_set_model

John Pickup
+1 for nested sets. There are a few ways to handle storing hierarchical and tree information in a SQL table; each approach requires you to do some design ahead of time and make tradeoffs to accomplish what you'd like
matt b