|Analogues | 1010data for SQL users ||
A UNION in SQL combines the rows from one table with the rows from another, pending both tables contain the same number of columns with matching data types, similar to a merge in 1010data. During this union, all duplicates are removed.
You want to combine the rows of two tables that contain weather observations for different years. You know how to do this in SQL by performing a UNION of the two tables, and you would like to obtain the same results using 1010data.
SELECT * FROM hourly_weather_90 UNION SELECT * FROM hourly_weather_91;
<base table="pub.demo.weather.hourly90"/> <merge table2="pub.demo.weather.hourly91" type="union"/>
With SQL, the default behaviour of UNION is to remove all duplicates from the resultant worksheet. The default behaviour for 1010data is to retain all rows, including duplicates. In order to obtain a worksheet with no duplicates, you must specify type="union" in the <merge> operation.
If you would like to learn more about the functions and operations discussed in this recipe, click on the links below: