update from and left join
update from and left join
От:
Tomasz Myrta <jasiek@klaster.net>
Дата:
Hello I have a query: update A set... from B left join C on (C.col1=B.col1 and C.col2=A.col2) where ... which gives me an error: ERROR: invalid reference to FROM-clause entry for table "A" HINT: There is an entry for table "A", but it cannot be referenced from this part of the query. I found two solutions: - table A self join 1:1 in "from" part of query, - table C subqueries in "where" clause - not too comfortable, because I need col2 value several times. Any other idea? The database is PostgreSQL 8.1.5. Regards, Tomasz Myrta