How can multiple tables be merged in SQL using the UNION statement?
In SQL, the UNION operator is used to combine the result sets of multiple tables into one result set. The specific implementation method is as follows:
SELECT column1, column2 FROM table1
UNION
SELECT column1, column2 FROM table2
UNION
SELECT column1, column2 FROM table3;
In the examples above, combine the results of column1 and column2 from table1, table2, and table3 into one result set. The UNION operator by default eliminates duplicate rows, but if you want to retain duplicate rows, you can use the UNION ALL operator.