References should be qualified if SELECT
has more than one referenced table/view.
NB: Except if they’re present in a USING
clause.
In this example, the reference ‘vee’ has not been declared and the variables ‘a’ and ‘b’ are potentially ambiguous.
SELECT a, b
FROM foo
LEFT JOIN vee ON vee.a = foo.a
Add the references.
SELECT foo.a, vee.b
FROM foo
LEFT JOIN vee ON vee.a = foo.a