Explain SELF JOIN ?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
where can you add custom error messages to sql server? : Sql server administration
What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008
What is the difference between 2-Tier architecture and 3-Tier architecture
15 Answers CTS, MCN Solutions, Oracle,
you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration
What is the default server name for sql server?
Write a sql query to display the current date?
How to list all objects in a given schema?
is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes or conversion errors?
What is full form of XP ?
42 Answers Cap Gemini, Infosys, Microsoft, Oracle, Reliance,
A successfully created SSIS package in SQL Server 2005 runs fine in MS BIDS and Integration Services. But gives error when run through an SQL-Job. What are the possible reasons?
Which system table contains information on constraints on all the tables created?
What part does database design plays a role in performance of an sql server-based application?