-
SQL语言基础中涉及的未明确限定的列名
资源介绍
限定不明确的列名
*
用表名作为前缀来限定在多个表中都出现的列名字.
利用表的前缀可以提高性能.
使用不同的别名来标志在不同表中的相同的名字。
*
Qualifying Ambiguous Column Names
You need to qualify the names of the columns in the WHERE clause with the table name to avoid ambiguity. Without the table prefixes, the DEPTNO column could be from either the DEPT table or the EMP table. It is necessary to add the table prefix to execute your query.
If there are no common column names between the two tables, there is no need to qualify the columns. However, you will gain improved performance by using the table prefix because you tell the Oracle Server exactly where to go to find columns.
The requirement to qualify ambiguous column names is also applicable to columns that may be ambiguous in other clauses, such as the SELECT clause or the ORDER BY clause.
Instructor Note
Demo: l4loc.sql
Purpose: To illustrate a SELECT clause with no aliases.
- 上一篇: 使用表的别名-SQL语言基础
- 下一篇: 连接多个表-SQL语言基础