限制不明确的列名-复杂查询技术-连接

时间:2024-05-15 15:58:09
【文件属性】:

文件名称:限制不明确的列名-复杂查询技术-连接

文件大小:671KB

文件格式:PPT

更新时间:2024-05-15 15:58:09

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 DEPARTMENT_ID column could be from either the DEPARTMENTS table or the EMPLOYEES 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, using the table prefix improves performance, because you tell the Oracle Server exactly where to find the 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: 4_loc.sql Purpose: To illustrate a SELECT clause with no aliases.


网友评论