2008/10/8 Andrus <kobruleht2@hot.ee>:
> Query
Query deleted for brevity
> ERROR: invalid reference to FROM-clause entry for table "destkonto"
> LINE 7: ... =sihrkurs.kuupaev AND sihrkurs.raha=destkonto....
> ^
> HINT: There is an entry for table "destkonto", but it cannot be referenced
> from this part of the query.
It's a question of precedence.
select * from a,b join c ...
is execute in the order of
b join c
then a join that result. By the way, this is how the sql spec says to do it.
So, you can't join b to c based on anything from a, because a hasn't
been joined yet. I would recommend using explicit join syntax only
and see how that works for you.