Mysql method of merging two tables: first confirm that the fields of the two tables must be the same, and the book order must be consistent; then write SQL directly and use UNION ALL to connect them.
Mysql method of merging two tables:
1. There is a condition before merging the result set. The fields in the two tables must be the same, and the book order must be consistent.
As shown in the picture: the first table: zp_201707
2, the second table: zp_201708. The fields and order of these two tables are consistent
3. We write SQL directly and connect them with UNION ALL, and the results will come out!
4. The same is true when we add conditional query, it is very simple
More related free learning recommendations: mysql tutorial(Video)
The above is the detailed content of How to merge two tables in mysql. For more information, please follow other related articles on the PHP Chinese website!