Kyle Lahnakoski

This document has moved

Self Joins

Introduction

History

Benefits

Long Paths

Semantics

Traveling Salesperson (relational, groupby=Path)

Types of Self Joins

  Aggregation

  Hierarchical Domains

Garbage Collector (relational, groupby=Node)

END OF DOCUMENT, REST IS NOTES

Single Self Join

Find the height of the head honcho on the hierarchy. The WHERE clause reduces the result set to the single employee we are interested in.

Better yet, the addition of the self join to the relation database operators makes SQL Turing complete!

<MAKE Universal Turing Machine>

kyle@lahnakoski.com