top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Self Join and why is it required?

+2 votes
451 views
What is Self Join and why is it required?
posted Jan 19, 2014 by Vishvachi Tiwari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
 
Best answer

Self Join is the act of joining one table with itself.
Self Join is often very useful to convert a hierarchical structure into a flat structure

Example:
SELECT e.name EMPLOYEE, m.name MANAGER
FROM EMPLOYEE e, EMPLOYEE m
WHERE e.mgr_id = m.id (+)

answer Jan 19, 2014 by Atul Mishra
Similar Questions
+1 vote

Forums

ID
Name
Description

Questions

ID
UserID
ForumID
Title
QuestionText
CreateDateTime

Replies

ID
UserID
QuestionID
ReplyText
CreateDateTime

users

UserID
UserName

I want to retrieve name of each forum, number of questions of each forum, number of replies of each forum, last post's UserName and date for each forum.

...