# mergeSelect

open fun mergeSelect(dest: Table, source: QueryAlias, transaction: Transaction, clauses: List<MergeStatement.Clause>, on: Op<Boolean>, prepared: Boolean): String

Generates the SQL MERGE command which synchronizes two datasets by inserting new rows, or updating/deleting existing ones in the target table based on data from subquery.

#### Parameters

dest

The table that will be modified.

source

The query providing the data for modification.

transaction

The transaction in which the operation will be executed.

clauses

A list of `MergeStatement.When` instances describing the `when` clauses of the SQL command.

on

The condition that determines whether to apply insertions or updates/deletions.