SQL Server – Self-Join Example Review

self-joinsql servert-sql

enter image description here
Here in this example it states that performs a self-join, but it joins Sales.SalesPerson to Sales.SalesTerritory. I knew that self join means joining the same table to itself but here aren't Sales.SalesPerson and Sales.SalesTerritory different tables? So is this considered self join though the tables are different? or is there a mistake?

source link

Best Answer

Looks like you are right in all observations and it is a mistake.

They are two separate tables (not views) and a self-join means a table joined to itself (and even a view or derived table or CTE joined to itself). You might even consider a join between a table and a view derived from that table to be a self-join but it is not the case here either.

I suggest you submit a bug report.

Link: list of AdventureWorks tables.