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.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
egerardus
  • 11,016
  • 12
  • 78
  • 119

3 Answers3

19

Kill the deprecated syntax if you can, but:

*= (LEFT JOIN)

=* (RIGHT JOIN)
marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Hart CO
  • 32,944
  • 5
  • 44
  • 59
4

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

Adriaan Stander
  • 156,697
  • 29
  • 278
  • 282
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?

Community
  • 1
  • 1
July.Tech
  • 1,226
  • 14
  • 18