Plese see examples at: Using MERGE to update matched items from a SELECT
Within the USING clause, you can have any complex SELECT statement.
Once you have the matching documents, you can UPDATE as you need.
Plese see examples at: Using MERGE to update matched items from a SELECT
Within the USING clause, you can have any complex SELECT statement.
Once you have the matching documents, you can UPDATE as you need.