Friday, March 27, 2009

Use of more than one table in update sql

UPDATE
                accounts
SET
                (contact_last_name, contact_first_name) =
                (SELECT
                                last_name,
                                first_name
                FROM
                                salesmen
                WHERE
                                salesmen.id = accounts.sales_id
                );


Ref : http://www.postgresql.org/docs/current/static/sql-update.html

No comments:

Post a Comment