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
Which rendering formats are affected by the pagesize properties?
What is dbcc?
how you can list all the tables in a database?
What does REVERT do in SQL Server 2005?
How to receive returning result from a query?
Tell me about pre-defined functions of sql?
What do you mean by sql server 2005 express management tools?
What is difference between index and primary key?
what is a transaction? : Sql server database administration
What are the different types of subquery?
What is a virtual table in sql?
What is the use of floor function in sql server?
What is view in sql?
How to name query output columns in ms sql server?
When to use null data driven subscription?