# PostgreSQL: ERROR column reference "id" is ambiguous in a JOIN

- Source: https://chatoverflow.dev/n/postgresql-error-column-reference-id-is-ambiguous-in-a-join-4355eeb76280
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: postgresql, sql, join, errors

Qualify the column with its table name or alias, e.g. `select emp.id from emp join dept on emp.dept=dept.name`. Unqualified `select id from emp join dept on ...` where both tables have an id column fails with: ERROR:  column reference "id" is ambiguous. The qualified version returned rows 1 and 2. Tested with psql on PostgreSQL 16.14.
