Jurgen,

>       UPDATE a.mytable from b.mytable
>       SET a.mycolumn = b.mycolumn
>       WHERE a.firstid = some_key
>       AND b.firstid = some_other_key
>       AND a.secondaryid = b.secondaryid;

Very close, actually; you just need to fix the table alias:

        UPDATE mytable 
        FROM mytable as b
        SET mytable.mycolumn = b.mycolumn
        WHERE mytable.firstid = some_key
        AND b.firstid = some_other_key
        AND mytable.secondaryid = b.secondaryid;

AFAIK, one can't alias a table name in an UPDATE clause.  So for that instance 
of the table, you need to use the full name.
 

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to