Handling Ambiguous Attribute Names

tags: #sql

We can prevent ambiguity by qualifying the attribute name with the relation name.

This means specifying the table or relation name along with the attribute name to avoid ambiguity when a column with the same name exists in multiple tables:

table_name.column_name

Consider the following:

SELECT customer.id, customer.name, orders.order_date
FROM customer
INNER JOIN orders ON customer.id = orders.customer_id;
Powered by Forestry.md