Question on sql syntax: *=

2019-02-21 13:44发布

问题:

I have some older (broken) code that has a join using a *=

table1.ID *= table2.ID

Is this a left outer join or a right outer join? (My error message indicates it is one of those)

回答1:

*= (LEFT OUTER JOIN)

=* (RIGHT OUTER JOIN)

But rather make use of the LEFT/RIGHT JOINS



回答2:

*= indicates left-outer join and =* indicates right-outer join.

EDIT:

I had my joins mixed up, have been corrected.



回答3:

please replace that with modern LEFT OUTER JOIN .. ON syntax!!

left outer join *=
right outer join =*



回答4:

table1.ID *= table2.ID if table1 & table2 are columns then in sqlserver it will give error in correct syntax it is better to use inner join