I don’t understand what you want to do exactly, but you can use the subquery in the subquery instructions:
UPDATE table1 a SET a.descr = (
SELECT MAX(b.descr || ' - ' || c.descr)
FROM table2 b, table3 c
WHERE b.account = a.account AND c.product = a.product
)
WHERE a.descr = ' '
MAX () will just pick a value for you. If you want to select it yourself, limit the additional subquery
source
share