SELF JOIN in SQL Server

SELF JOIN in SQL Server

In this article, the SQL SELF JOIN is used to join a table with itself, a self JOIN is a regular join.

Syntax

SELECT a.column_name, b.column_name...
FROM table1 a, table1 b
WHERE a.common_id = b.common_id

Example

SELECT  a.ID, b.NAME, a.SALARY
   FROM CUSTOMER a, CUSTOMER b
   WHERE a.SALARY > b.SALARY

2020-04-21