Declaring an alias for the target table
You can declare an alias for the target table. The alias can reference the fully-qualified database object name of a local or remote table, view, or synonym.
The alias is a temporary name that is not registered in the system catalog of the database, and that persists only while the UPDATE statement is running.
If the name that you declare as the alias is also a keyword of
the UPDATE statement, you must use the AS keyword to clarify the syntax:
UPDATE stock AS set
SET unit_price = unit_price * 0.94;
The following UPDATE statement references the qualified name of
a table in the target clause and in two subqueries:
UPDATE nmosdb@wnmserver1:test
SET name=(SELECT name FROM test
WHERE test.id = nmosdb@wnmserver1:test.id)
WHERE EXISTS(
SELECT 1 FROM test WHERE test.id = nmosdb@wnmserver1:test.id
);
The next UPDATE statement is logically equivalent to the previous
example, but declares r_t an alias for the qualified table
name:
UPDATE nmosdb@wnmserver1:test r_t
SET name=(SELECT name FROM test
WHERE test.id = r_t.id)
WHERE EXISTS(
SELECT 1 FROM test WHERE test.id = r_t.id
);
Declaring the table alias simplifies the notation of the second example above.