Union


Description

Combines two subqueries into a single one. Databricks SQL supports three types of set operators:

  • EXCEPT

  • INTERSECT

  • UNION

(Databricks SQL Language Reference UNION)

Set operators allow queries to be combined. (Snowflake SQL Language Reference UNION)

Syntax

subquery1 { { UNION [ ALL | DISTINCT ] |
              INTERSECT [ ALL | DISTINCT ] |
              EXCEPT [ ALL | DISTINCT ] } subquery2 } [...] }

Sample Source Patterns

Setup data

Databricks

Snowflake

Pattern code

Databricks

Snowflake

Known Issues

No related EWIs

  • MSC-S000#: SET OPERATOR WITH ALL IS TRANSFORMED TO A JOIN.

Last updated

Was this helpful?