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 is the sql case statement used for? Explain with an example?
What are the advantages of using third-party tools?
After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas
Why use “pivot” in sql server?
How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?
What are the reporting services components?
What is the data tier application?
What is indexed view?
Do you know what guidelines should be followed to help minimize deadlocks?
When you use @@error and try-catch?
Can you explain what is sql server english query?
What is a cube? : sql server analysis services, ssas
How the authentication mode can be changed?
What is the stuff?
How to check if stored procedure is running in sql server?