In the following query, the reference to bar.foo_id is not correct because the table bar has to be referenced through the defined alias.
select f.* from foo f join bar b on bar.foo_id = f.id;
SQL Server
Connection to "User=thomas, Database=ThomasDB, URL=jdbc:jtds:sqlserver://localhost/ThomasDB" successful thomas@ThomasDB/dbo> select f.* ..> from foo f ..> join bar b on bar.foo_id = f.id; The multi-part identifier "bar.foo_id" could not be bound. [SQL State=S1000, DB Errorcode=4104]
MySQL
Connection to "User=thomas, Database=thomasdb, URL=jdbc:mysql://localhost/thomasdb" successful thomas@thomasdb> select f.* ..> from foo f ..> join bar b on bar.foo_id = f.id; Unknown column 'bar.foo_id' in 'on clause'
Oracle
Connection to "User=thomas, URL=jdbc:oracle:thin:@localhost:1521:oradb" successful
thomas> select f.*
..> from foo f
..> join bar b on bar.foo_id = f.id;
Error at line 3:
ORA-00904: "BAR"."FOO_ID": invalid identifier
join bar b on bar.foo_id = f.id
^
thomas>
Postgres
Connection to "User=thomas, Schema=public, URL=jdbc:postgresql://localhost/postgres" successful
thomas@postgres/public> select f.*
..> from foo f
..> join bar b on bar.foo_id = f.id;
ERROR: invalid reference to FROM-clause entry for table "bar"
Hint: Perhaps you meant to reference the table alias "b".
Position: 39
join bar b on bar.foo_id = f.id
^
thomas@postgres/public>