The Art of SQL

Dealing with Hierarchical Data

The golden rule is that there are no golden rules.

George Bernard Shaw (18561950)

Man and Superman/Maxims for

Revolutionists

You have seen in the previous chapter that queries sometimes refer to the same table several times and that results can be obtained by joining a row from one table to another row in the same table. But there is a very important case in which a row is not only related to another row, but is dependent upon it. That latter row is itself dependent on another oneand so forth. I am talking here of the representation of hierarchies.

Категории