Stay organized with collectionsSave and categorize content based on your preferences.
Version 4.0.25.14 (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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# Create Merge Query\n\nVersion 4.0.25.14 (latest)\n\n### Create Merge Query\n\nCreates a new merge query object.\n\nA merge query takes the results of one or more queries and combines (merges) the results\naccording to field mapping definitions. The result is similar to a SQL left outer join.\n\nA merge query can merge results of queries from different SQL databases.\n\nThe order that queries are defined in the source_queries array property is significant. The\nfirst query in the array defines the primary key into which the results of subsequent\nqueries will be merged.\n\nLike model/view query objects, merge queries are immutable and have structural identity - if\nyou make a request to create a new merge query that is identical to an existing merge query,\nthe existing merge query will be returned instead of creating a duplicate. Conversely, any\nchange to the contents of a merge query will produce a new object with a new id.\n\nRequest\n-------\n\nPOST /merge_queries \nDatatype \nDescription \nRequest \nHTTP Request \nbody \nHTTP Body \nExpand HTTP Body definition... \nbody \n[MergeQuery](/looker/docs/reference/looker-api/latest/types/MergeQuery) \nMerge Query\nExpand MergeQuery definition... \ncan \n*lock* \nobject \nOperations the current user is able to perform on this object \ncolumn_limit \nstring \nColumn Limit \ndynamic_fields \nstring \nDynamic Fields \nid \n*lock* \nstring \nUnique Id \npivots \nstring\\[\\] \nresult_maker_id \n*lock* \nstring \nUnique to get results \nsorts \nstring\\[\\] \nsource_queries \n[MergeQuerySourceQuery](/looker/docs/reference/looker-api/latest/types/MergeQuerySourceQuery)\\[\\] \ntotal \nboolean \nTotal \nvis_config \nobject \nVisualization Config \nquery \nHTTP Query \nExpand HTTP Query definition... \nfields \nstring \nRequested fields\n\nResponse\n--------\n\n### 200: Merge Query\n\nDatatype \nDescription \n(object) \n[MergeQuery](/looker/docs/reference/looker-api/latest/types/MergeQuery) \ncan \n*lock* \nobject \nOperations the current user is able to perform on this object \ncolumn_limit \nstring \nColumn Limit \ndynamic_fields \nstring \nDynamic Fields \nid \n*lock* \nstring \nUnique Id \npivots \nstring\\[\\] \nresult_maker_id \n*lock* \nstring \nUnique to get results \nsorts \nstring\\[\\] \nsource_queries \n[MergeQuerySourceQuery](/looker/docs/reference/looker-api/latest/types/MergeQuerySourceQuery)\\[\\] \nExpand MergeQuerySourceQuery definition... \nmerge_fields \n[MergeFields](/looker/docs/reference/looker-api/latest/types/MergeFields)\\[\\] \nExpand MergeFields definition... \nfield_name \nstring \nField name to map onto in the merged results \nsource_field_name \nstring \nField name from the source query \nname \nstring \nDisplay name \nquery_id \nstring \nId of the query to merge \nquery_slug \nstring \nSlug of the query to merge \ntotal \nboolean \nTotal \nvis_config \nobject \nVisualization Config\n\n### 400: Bad Request\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 404: Not Found\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 409: Resource Already Exists\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 422: Validation Error\n\nDatatype \nDescription \n(object) \n[ValidationError](/looker/docs/reference/looker-api/latest/types/ValidationError) \nmessage \n*lock* \nstring \nError details \nerrors \n[ValidationErrorDetail](/looker/docs/reference/looker-api/latest/types/ValidationErrorDetail)\\[\\] \nExpand ValidationErrorDetail definition... \nfield \n*lock* \nstring \nField with error \ncode \n*lock* \nstring \nError code \nmessage \n*lock* \nstring \nError info message \ndocumentation_url \n*lock* \nstring \nDocumentation link \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 429: Too Many Requests\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\nExamples\n--------\n\n### TypeScript"]]