I have three tables: suppliers, parts, and types. I need to join all of them while highlighting columns with the same name (for example, "id") in three tables. I would like to successfully run this query:
CREATE VIEW Everything AS SELECT Suppliers.name as supplier, Parts.id, Parts.description, Types.typedesc as type FROM Suppliers JOIN (Parts JOIN Types ON Parts.type_id = Types.id) ON Suppliers.id = Parts.supplier_id;
My DBMS (sqlite) complains that "there is no such column (Parts.id)". I assume that it forgets the table names after the JOIN completes, but then how can I access the id column that refers to the Parts table?
source share