Home > Blockchain >  Joining column preference in SQL Server
Joining column preference in SQL Server

Time:03-29

select *
from tableA ta
inner join tableB tb on tb.columnbid = ta.columnaid

When joining 2 tables, is the joining column preference important?

Should I use

on ta.columnaid = tb.columnbid 

instead?

CodePudding user response:

No, the order of the equation does not play any part in execution or optimisation.

CodePudding user response:

The equation tb.columnbid=ta.columnaid simply means that show only those rows where both of them are equal. So the order doesn't matter. You can write ta.columnaid=tb.columnbid and will find the same result.

  • Related