http://www.thescripts.com/forum/thread400261.html
How to perform self-joins in postgres.