Dan Sullivan shows how to use Common Table Expressions to query hierarchical data in SQL Server 2005. Hierarchical queries combine recursive SELECT commands to provide the functionality to query self-referencing data.
Hierarchical queries are useful in HR apps for employee->boss representation, in financial applications for accounts chart hierarchy and in inventory applications where parts can be assembled from other parts.