Home >Database >Mysql Tutorial >What Does '*=' Mean in Older Transact-SQL Joins?

What Does '*=' Mean in Older Transact-SQL Joins?

DDD
DDDOriginal
2025-01-03 13:35:38431browse

What Does

Unveiling the Mystery of "*=" in Transact-SQL Joins

In the realm of Transact-SQL (TSQL), an ancient convention arose—a peculiarity that left many scratching their heads: the enigmatic "*=". What profound meaning did this symbol hold?

Unraveling the Syntax

Encountering the cryptic join condition "WHERE table1.yr =* table2.yr -1" can evoke a sense of puzzlement. What sorcery is at play here?

Behold, the wisdom of the ancients: this syntax represents an outer join relic from the pre-2005 era of TSQL. Unlike the more familiar ANSI JOIN syntax, this old convention denoted an outer join.

The Age-Old Syntax

To illuminate the meaning further, consider this archaic form of outer join:

"WHERE t.column =* s.column"

In this construction, "t" and "s" represent two tables, and "column" identifies the column(s) on which the join is performed. The "*=" operator establishes an outer join, where NULL values are not excluded from the result.

A Legacy of the Past

It's essential to note that this syntax is obsolete and not recognized by modern SQL standards. When encountered in legacy code, it should be avoided or refactored into the more current and unambiguous ANSI JOIN syntax.

Reference

For those venturing deeper into the annals of TSQL history, "SQL Server 2005 Outer Join Gotcha" provides further insights into this curious relic.

The above is the detailed content of What Does '*=' Mean in Older Transact-SQL Joins?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn