Version 4.0.26.22 (latest)

### Create Merge Query

Creates a new merge query object.

A merge query takes the results of one or more queries and combines (merges) the results
according to field mapping definitions. The result is similar to a SQL left outer join.

A merge query can merge results of queries from different SQL databases.

The order that queries are defined in the source_queries array property is significant. The
first query in the array defines the primary key into which the results of subsequent
queries will be merged.

Like model/view query objects, merge queries are immutable and have structural identity - if
you make a request to create a new merge query that is identical to an existing merge query,
the existing merge query will be returned instead of creating a duplicate. Conversely, any
change to the contents of a merge query will produce a new object with a new id.

## Request

POST /merge_queries Datatype Description Request HTTP Request body HTTP Body Expand HTTP Body definition... body [MergeQuery](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/MergeQuery) Merge Query Expand MergeQuery definition... can object Operations the current user is able to perform on this object column_limit string Column Limit dynamic_fields string Dynamic Fields id string Unique Id pivots string\[\] result_maker_id string Unique to get results sorts string\[\] source_queries [MergeQuerySourceQuery](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/MergeQuerySourceQuery)\[\] total boolean Total limit string Limit vis_config object Visualization Config query HTTP Query Expand HTTP Query definition... fields string Requested fields

## Response

### 200: Merge Query

Datatype Description (object) [MergeQuery](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/MergeQuery) can object Operations the current user is able to perform on this object column_limit string Column Limit dynamic_fields string Dynamic Fields id string Unique Id pivots string\[\] result_maker_id string Unique to get results sorts string\[\] source_queries [MergeQuerySourceQuery](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/MergeQuerySourceQuery)\[\] Expand MergeQuerySourceQuery definition... merge_fields [MergeFields](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/MergeFields)\[\] Expand MergeFields definition... field_name string Field name to map onto in the merged results source_field_name string Field name from the source query name string Display name query_id string Id of the query to merge query_slug string Slug of the query to merge total boolean Total limit string Limit vis_config object Visualization Config

### 400: Bad Request

Datatype Description (object) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

### 404: Not Found

Datatype Description (object) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

### 409: Resource Already Exists

Datatype Description (object) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

### 422: Validation Error

Datatype Description (object) [ValidationError](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/ValidationError) message string Error details errors [ValidationErrorDetail](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/ValidationErrorDetail)\[\] Expand ValidationErrorDetail definition... field string Field with error code string Error code message string Error info message documentation_url string Documentation link documentation_url string Documentation link

### 429: Too Many Requests

Datatype Description (object) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

## Examples

### TypeScript


|---|
| [https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/kotlin.gen.spec.ts](https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/kotlin.gen.spec.ts#L247 "https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/kotlin.gen.spec.ts") |
| [https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/python.gen.spec.ts](https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/python.gen.spec.ts#L1030 "https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/python.gen.spec.ts") |
| [https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/typescript.gen.spec.ts](https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/typescript.gen.spec.ts#L517 "https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/typescript.gen.spec.ts") |