---
title: "What is a self join in sql server"  
description: "What is a self join in sql server"  
author: "Anonymous User"  
published: 2015-12-06  
updated: 2015-12-07  
canonical: https://www.mindstick.com/forum/33686/what-is-a-self-join-in-sql-server  
category: "database"  
tags: ["sql server", "sql", "sql server 2008", "sql server 2012"]  
reading_time: 1 minute  

---

# What is a self join in sql server

I want to know [Self join](https://www.mindstick.com/interview/831/what-is-a-self-join) in [sqlserver](https://www.mindstick.com/forum/33737/between-condition-in-sqlserver) How to use It.please help me.

## Replies

### Reply by Anonymous User

A self join is a join in which a table is joined with itself. For example, when you require details about an employee and his manager (also an employee)

### Reply by Anonymous User

A [self](https://www.mindstick.com/articles/44535/smart-ways-to-secure-self-storage-facilities) [join](https://www.mindstick.com/articles/1487/join-sleep-and-interrupt-methods-in-c-sharp-threading) is basically when a table is joined to itself. The way you should visualize a self join for a given table is by imagining that a join is performed between two identical copies of that table. And that is exactly why it is called a self join – because of the fact that it’s just the same table being joined to anothercopy of itself rather than being joined with a different table.

```
 SELECT e1.Emp_ID,e1.Emp_Name,e1.Emp_Sal  FROM employee e1, employee e2WHERE e1.Location = e2.LocationAND e2.Location='allahabad'
```

![What is a self join in sql server](https://www.mindstick.com/mindstickforums/c6270039-dbae-4254-8f8a-3aa2e0a4caf1/images/ed45a513-27de-427f-b442-93450be2d3de.png)


---

Original Source: https://www.mindstick.com/forum/33686/what-is-a-self-join-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
