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 |
9. Write a query to list a new column with the difference in temp of the cities Delhi and Mumbai, Mumbai and Jammu and soon. Consider the following table : City_id City Temp. 1 delhi 40 2 Mumbai 35 3 Jammu 32 4 Pune 18
How do I open a .db file?
explain different types of constraints? : Sql server database administration
What are the limitation of the Online Index Rebuild Operation?
What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
Why the trigger fires multiple times in single login?
Explain how to use linked server?
Explain different backup plans?
How to select nth record from a table?
13 Answers DELL, Microsoft, Ramco,
What is the process of normalising?
Explain SELF JOIN ?
What is the bookmark lookup and rid lookup?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)