DELETE and SELECT (Level 4)
|SQL Server 6.x||SQL Server 2000|
|Duplicate table names in the FROM clause of Microsoft® SQL Server™ version 6.0 DELETE or SELECT statement caused SQL Server to treat both table references as the same table. SQL Server discarded the reference to the second authors table in this SELECT example:
However, if the table names specified in the FROM clause of the DELETE or SELECT were not identical, SQL Server version 6.0 treated the two table references as two different tables as in this SELECT example:
|Duplicate table names in the FROM clause of a DELETE or SELECT statement generate errors in SQL Server. Rewrite statements using aliases. Here is a SELECT example:
Expect different results as compared to SQL Server version 6.0. Rewrite DELETE and SELECT statements to use aliases in the FROM clause when referring to more than one instance of the same table.