Postgres – Self Join in PostgreSQL



Postgres – Self Join in PostgreSQL

Postgres - Self Join in PostgreSQL

A self join is a join in which a table is joined with itself.
To join a table itself means that each row of the table is combined with itself and with every other row of the table.
The table appears twice in the FROM clause and is followed by table aliases that qualify column names in the join condition.
The self join can be viewed as a join of two copies of the same table. The table is not actually copied, but SQL performs the command as though it were.
To perform a self join, Oracle Database combines and returns rows of the table that satisfy the join condition
Syntax:
SELECT a.column_name, b.column_name…
FROM table1 a, table1 b
WHERE a.common_filed = b.common_field;

sql tutorial,learn sql,sql for beginners,sql basics,sql tutorial for beginners,#SQL,structured query language,introduction to sql,#RDBMS,#PGClient,Learn SQL,#postgres,#postgresql tutorial,#postgres tutorial,#what is postgresql,#what is postgres,#postgresql tutorial for beginners,#postgresql course,postgres,postgresql,postgresql tutorial,postgres tutorial,what is postgresql,what is postgres,history of postgresql,postgressql,postgresql tutorial for beginners

Comments are closed.