Previously, I believed that the join order was specified in the SQL 92 standard.
Which means you would write your query using INNER JOIN
syntax like this:
SELECT EMP.EMPNAME,EMP.EMPID,
EMP.EMPDEPID,DEPT.DEPTID
FROM EMPLOYEE EMP
inner join DEPARTMENT DEPT on EMP.EMPDEPID=DEPT.DEPTID;
This incorrect information was was enforced by LINQ where in the join, the first join element corresponds to the first or previously declared table.
The specification however just indicates that the join must match a <search condition>
.
<join specification> ::=
<join condition>
| <named columns join>
<join condition> ::= ON <search condition>
This search condition is the same that is used in the WHERE
clause exactly like your SQL 89 style join.
The <search condition>
is defined as:
<search condition> ::=
<boolean term>
| <search condition> OR <boolean term>
Therefore, as long as you create a boolean term in your search condition, the query is valid. EMP.EMPDEPID=DEPT.DEPTID
and DEPT.DEPTID=EMP.EMPDEPID
are both boolean terms and evaluate to the same thing. Thus, no difference between them.