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.
That is the ANSI SQL 1989 syntax for RIGHT OUTER JOIN, where *= would be the LEFT OUTER JOIN. You should note also that putting the join syntax in the WHERE clause is deprecated in SQL 2008.
An asterisk (" * ") can be used to specify that the query should return all columns of the queried tables. SELECT is the most complex statement in SQL, with optional keywords and clauses that include: The FROM clause, which indicates the table(s) to retrieve data from.
+= (Addition Assignment) (Transact-SQL)Adds two numbers and sets a value to the result of the operation. For example, if a variable @x equals 35, then @x += 2 takes the original value of @x, add 2 and sets @x to that new value (37).
COUNT(*) returns the number of items in a group. This includes NULL values and duplicates. COUNT(ALL expression) evaluates expression for each row in a group, and returns the number of nonnull values.
Kill the deprecated syntax if you can, but:
*= (LEFT JOIN)
=* (RIGHT JOIN)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With