anSI SQL-89 Syntax
SQL Server also supports an older syntax for cross joins that was introduced in ANSI SQL-89. In this
syntax you simply specify a comma between the table names, like this.
SELECT C.custid, E.empid
FROM Sales.Customers AS C, HR.Employees AS E;
There is no logical or performance difference between the two syntaxes. Both syntaxes are integral
parts of the latest SQL standard (ANSI SQL:2011 at the time of this writing), and both are fully sup-
ported by the latest version of SQL Server (Microsoft SQL Server 2012 at the time of this writing). I am
not aware of any plans to deprecate the older syntax, and I don’t see any reason to do so while it’s an
integral part of the standard. However, I recommend using the ANSI SQL-92 syntax for reasons that
will become clear after inner joins are explained.
Do'stlaringiz bilan baham: |