Join a table to itself in SQL

It recently came to my attention that some developers may not know how to join a table to itself. For them, I write this. Why would you want to do such a thing? Perhaps you have a company that is owned by another company, and you want to get any subsidiaries of a given company.

[More]

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Really it's the simple way to join table it self

it solve me a problem take one day trials.

thanks aot.
# Posted By Hamdy Mohamed | 5/17/07 3:49 PM
Glad it helped!
# Posted By Steve Bryant | 5/18/07 8:26 PM
Thanks, very useful!
# Posted By Ash | 7/11/07 1:24 PM
Hmm... doesn't seem to work well with temporary tables. (Error: Can't reopen table: 't1')

Any thoughts?
# Posted By Mark | 6/19/11 3:48 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.