Problem: same foreign keys in multiple tables

Hi all,

I have the same foreign keys column name in two tables. Now when I try to do a JOIN the query no longer works. I think the error message mentioned the term “ambiguous”.

Does anyone know how to fix this?

INNER JOIN
table AS T USING (countries_id)

Thank you!

yup… don’t use USING

instead, use ON and fully qualify both join columns, e.g.


FROM x JOIN y ON x.foo = y.foo

I suppose that might also work…

Thanks a lot Rudy, you have been a big help :slight_smile: