What is a self join in SQL Server?

What is a self join in SQL Server?

- It is a query in which Two instances of the same table will be joined in the query.
- It is used to join a table to itself.

Syntax:
SELECT a.column_name, b.column_name, …
FROM table1 a, table1 b
WHERE a.commonfield = b.commomfield;

Example:
SELECT a.eid, b.ename, a.esalary
FROM EMPLOYEE a, EMPLOYEE b
WHERE a. esalary < b.salary;
Difference between UNION ALL and UNION
UNION statement eliminates duplicate rows whereas UNION ALL statement includes duplicate rows........
Disadvantages of cursor
Cursor manipulates records row by row. It requires temporary storage for row manipulation........
What is LOG Shipping?
This process synchronizes two SQL servers and thus provides ready server in case one fails........
Post your comment