SQL Server *= operator [duplicate]
Asked Answered
R

3

8

I came across some code with this *= operator in a WHERE clause and I have only found one thing that described it as some sort of join operator for Sybase DB. It didn't really seem to apply. I thought it was some sort of bitwise thing (which I do not know much about) but it isn't contained in this reference at all.

When I change it to a normal = operator it doesn't change the result set at all.

The exact query looks like this:

select distinct 
       table1.char8_column1,
       table1.char8_column2,
       table2.char8_column3,
       table2.smallint_column
from   table1, table2
where  table1.char8_column1 *= table2.another_char8_column

Does anyone know of a reference for this or can shed some light on it? This is in SQL Server 2000.

Resin answered 15/8, 2013 at 16:2 Comment(0)
P
20

Kill the deprecated syntax if you can, but:

*= (LEFT JOIN)

=* (RIGHT JOIN)
Pedicular answered 15/8, 2013 at 16:7 Comment(0)
S
5

That would be the "old school" equivalent of a LEFT JOIN.

Saxhorn answered 15/8, 2013 at 16:4 Comment(0)
C
3

It is legacy syntax for specifying outer joins, Microsoft refers to it as "non-ANSI outer join operators". These outer join operators (= and =) are not supported when the compatibility level of the database is set to 90.

This question has been answered on StackOverflow before: What is this operand (*= star-equals) in SQL server 2000?

Chuipek answered 15/8, 2013 at 16:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.