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

Can we use where clause in union?

0 Answers  


How can you see what type of locks used?

1 Answers  


What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas

0 Answers  


What is the default sql server instance name?

0 Answers  


What is use of except clause? How does it differ from not in clause?

0 Answers  






which query u can write to sql server doesn't work inbetween 7.00PM to nextday 9.00AM

5 Answers   Wipro,


List some of the rules that apply to creating and using a ‘view’

0 Answers  


Why we need to use secondry database file? though, we can do same work using primary database file also.

2 Answers   Microsoft,


How to retrieve duplicate rows in a table? How to delete the duplicate entries in a table?

15 Answers   Leo Technologies, Mannar Company, Synechron,


What is the primary use of the model database?

0 Answers  


What is the difference between a fill factor of 100 and 0?

0 Answers  


What is order of B+tree?

0 Answers   HCL,


Categories