Home | Previous Page | Next Page   Modifying Data > Updating Rows >

Using a Join to Update a Column

Extended Parallel Server allows you to use a join on tables to determine which columns to update. You can use columns from any table that you list in the FROM clause in the SET clause to specify values for the columns and rows to update.

When you use the FROM clause, you must include the name of the table in which the update is to be performed. Otherwise, an error results. The following example illustrates how you can use the UPDATE statement with a FROM clause:

UPDATE t SET a = t2.a FROM t, t2 WHERE t.b = t2.b

In the preceding example, the statement performs the same action as it does when you omit the FROM clause altogether. You are allowed to specify more than one table in the FROM clause of the UPDATE statement. However, if you specify only one table, it must be the target table.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]