views:

99

answers:

6

Possible Duplicate:
SQL: What does =* mean?

I am going through some legacy code and found a query like this:

SELECT * from foo_table, bar_Table where foo_table.id *= bar_table.fac_id

What does the *= operator do?

A: 

They are LEFT OUTER JOIN and RIGHT OUTER JOIN. Which is which escapes me at the moment.

Ignacio Vazquez-Abrams
A: 

Is like a left outer join or right outer join in pl-sql.

Jose Chama
A: 

That's the old way to do joins. "*=" means "left outer join".

David
+1  A: 

I believe that is an old style way of referring to left and right inner and outer joins. Here is an article about it, and it being deprecated:

http://blogs.technet.com/wardpond/archive/2008/09/13/deprecation-of-old-style-join-syntax-only-a-partial-thing.aspx#3123714

Randy Minder
+6  A: 

That is the old and no longer recommended way of specifying table joins.

The modern equivalent to what you're seeing would be:

SELECT * 
FROM foo_table
LEFT JOIN bar_Table ON foo_table.id = bar_table.fac_id
Paul Sasik
I assume, then, that =* means right join?
scottm
Exactly. Right outer join to be completely pedantic.
Paul Sasik
A: 

It means replace this code immediately as it is not guaranteed to give accurate results even as far back as SQL Server 2000. Sometimes instead of an outer join SQL Server intreprets this as a cross join. This is dangerous and incorrect code that has been deprecated.

HLGEM