Answer Posted / 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 |
Post New Answer View All Answers
What are sub reports?
What are the kinds of subquery?
How to test odbc dsn connection settings?
when would you go for denormalization? : Sql server database administration
Can We Use Data-grids For Our Report In Ssrs?
What is measure group, measure? : sql server analysis services, ssas
How to download and install sql server 2005 books online?
What happens to a statement batch if there is a compilation error?
Which are the two editions in which SQL Azure database available?
What is table level trigger?
We need to perform what steps in the following order to work with a cursor?
What are the steps to insert a table?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What are types of storage modes? : sql server analysis services, ssas
What is indexing a document?