UPDATE SET { column_name = { expression | DEFAULT } |
- ( column_name [, ...] ) = ( { expression | DEFAULT } [, ...] ) } [, ...]
+ ( column_name [, ...] ) = [ ROW ] ( { expression | DEFAULT } [, ...] ) |
+ ( column_name [, ...] ) = ( sub-SELECT )
+ } [, ...]
Parameters
+
+ with_query
+
+ The WITH clause allows you to specify one or more
+ subqueries that can be referenced by name in the MERGE
+ query. See and
+ for details. Note that WITH RECURSIVE is not supported
+ by MERGE.
+
+
+
+
target_table_name
An expression to assign to the column. If used in a
WHEN MATCHED clause, the expression can use values
from the original row in the target table, and values from the
- <literal>data_source> row.
+ <replaceable class="parameter">data_source> row.
If used in a WHEN NOT MATCHED clause, the
- expression can use values from the data_source.
+ expression can use values from the
+ data_source row.
- with_query
+ sub-SELECT
- The WITH clause allows you to specify one or more
- subqueries that can be referenced by name in the MERGE
- query. See and
- for details.
+ A SELECT sub-query that produces as many output columns
+ as are listed in the parenthesized column list preceding it. The
+ sub-query must yield no more than one row when executed. If it
+ yields one row, its column values are assigned to the target columns;
+ if it yields no rows, NULL values are assigned to the target columns.
+ The sub-query can refer to values from the original row in the target table,
+ and values from the data_source
+ row.