限定不明确的列名-SQL语言基础

时间:2024-05-15 13:24:57
【文件属性】:

文件名称:限定不明确的列名-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:24:57

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.


网友评论