What is self join and when would you use it? I don’t understand self joins so a layman explanation with an example would be great.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use a self join when a table references data in itself.
E.g., an
Employeetable may have aSupervisorIDcolumn that points to the employee that is the boss of the current employee.To query the data and get information for both people in one row, you could self join like this: