Select and Subselect Column Names
Earlier, we discussed Qualifying Column Names under the discussion on JOINs.
Any column names can be explicitly qualified. Within a statement with a subselect, column names are implicitly qualified by the table referenced in the FROM statement. Inner column names are implied to be qualified by the inner FROM clause and outer column names are implied to be qualified by the outer FROM clause.
You can explicitly qualify column names to override SQL’s assumptions about which tables are associated with which column names.
If the same column name is in two or more tables in the same statement, it is best to explicitly qualify these column names for clarity.
For correlated subselects, references in an inner subselect to a column name in a table of the outer subselect most be explicitly qualified.