Join operators and commutativity

不打扰是莪最后的温柔 提交于 2019-12-02 10:49:45

The order of the columns in the ON part of the statement doesn't influence how the JOIN itself is done.

This:

SELECT t1.columnA, t2.columnB
FROM Table1 t1
   JOIN Table2 t2 ON t1.ID = t2.ID

will yield the same results as this:

SELECT t1.columnA, t2.columnB
FROM Table1 t1
   JOIN Table2 t2 ON t2.ID = t1.ID

The self-join you described would have been something like this:

SELECT t1.columnA, t2.columnB
FROM Table1 t1
   JOIN Table1 t2 ON t1.managerID = t2.employeeID
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!