Use of SQL Self JOIN

Use of SQL Self JOIN

Instructor-svgAl-Mamun Sarkar
Apr 15 , 2020

SQL Self JOIN. In this lesson, I will show you how to use SQL Self JOIN on while querying data from the database using the SQL query.

 

SELF JOIN Syntax:

SELECT t1.column, t2.column
FROM table1 t1, table1 t2
WHERE condition;

Example:

SELECT A.name AS name1, B.name AS name2
FROM employees A, employees B
WHERE A.id <> B.id;

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram