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 does the on delete cascade option do?
What is pessimistic concurrency?
Is it possible to create trigger on views?
What are the events recorded in a transaction log?
What are truncate options available in sql server? : sql server database administration
What is table valued function and scalar valued functions?
What are the purpose of Normalisation?
How to set database to be single_user in ms sql server?
what are user defined datatypes and when you should go for them? : Sql server database administration
How to create a trigger for insert only?
How to select some specific columns from a table in a query in ms sql server?
What new data source types were added in ssrs 2014?
Write a program to fetch first 10 records from a file?
List the data types available in mssql?
Tell me what is difference between clustered and non clustered index?