Snowflake Vs MS-SQL - Part 70 - UNION By Name
UNION By Name
Sometimes, we have to combine data from multiple tables. In this case, we can use UNION. However, the catch is that the order of the columns should be the same.
MS-SQL Server
In Snowflake, we can use the same query as above; however, we have to use the same column order in the select clause. However, we can use UNION BY Name as below. The order of the columns in the select clause does not matter.
NOTE: Similarly, you can use UNION ALL BY NAME.
Comments
Post a Comment