On 16/08/07, Rodrigo De León <[EMAIL PROTECTED]> wrote:
> On Aug 15, 11:46 pm, [EMAIL PROTECTED] ("Phoenix Kiula") wrote:
> > Appreciate any tips, because it would
> > be nasty to have to do this with millions of UPDATE statements!
>
> - Create an interim table
> - COPY the data into it
> - Do an UPDATE ... FROM ...Thanks! I thought about it and then gave up because SQL trumped me up. Could you please suggest what the query should look like? Based on this: http://www.postgresql.org/docs/8.1/static/sql-update.html I tried this: UPDATE t1 SET title = title FROM t2 WHERE t1.id = t2.id; But I am miles from what it needs to be! The example in the docs does not refer to a column in the other table, it just increments a value in the same table based on the join ("UPDATE employees SET sales_count = sales_count + 1 FROM accounts...."). TIA! ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/
