Explain SELF JOIN ?

Answers were Sorted based on User's Feedback



Explain SELF JOIN ?..

Answer / manoj pandey

SELF JOIN is like joining a table with itself, to get a recursive series of data within the table. Like in Employee table to get Manager details you need to join Manager ID with Employee ID in the same table, like:

SELECT
E.EmployeeID,
E.EmployeeName,
E.ManagerID,
M.EmployeeName as ManagerName
FROM Employee E
LEFT JOIN Employee M
ON M.EmployeeID = E.ManagerID

~Manoj(SQLwithManoj.wordpress.com)

Is This Answer Correct ?    3 Yes 0 No

Explain SELF JOIN ?..

Answer / dinesh rathod

Self join is just like any other join, except that two instances of the same table will be joined in the query

Is This Answer Correct ?    2 Yes 0 No

Explain SELF JOIN ?..

Answer / sandhya

JOINING TO TABLE ITSELF IS CALLED SELF JOIN. HERE WE ARE USING THE SAME TABLE WITH DIFFERENT ALIYAS'S.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL Server Interview Questions

From where can you change the default port?

3 Answers  


What is stretch database in sql server?

0 Answers  


why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

0 Answers  


Working with TLogs

0 Answers  


What are the hotfixes and patches in sql server?

0 Answers  






What is Right Outer Join?

2 Answers  


What stored procedure would you use to view lock information?

0 Answers  


When multiple after triggers are attached to sql table, how to control the order of execution?

0 Answers  


How to update multiple rows with one update statement in ms sql server?

0 Answers  


Explain the difference between cross join and full outer join?

0 Answers  


What is the need for group functions in sql?

0 Answers  


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

0 Answers  


Categories