Get the App
SLTechnology News&Howtos  ›  Development  › 

What points should be paid attention to when using union in mysql?

Shulou Source: shulou.com Published: 2022-06-03 07:35:21 10月03日 Update

Mysql use union need to pay attention to what points, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

1. The union operator is used to combine the results of more than two select statements into one result set. Multiple select statements delete duplicate data.

2. When using union to merge result sets, the two result sets are required to have the same number of columns.

Example

Select playerno, townfrom PLAYERSwhere town = 'Inglewood'unionselect playerno, townfrom PLAYERSwhere town =' Plymouth'; after reading the above, have you mastered what points mysql needs to pay attention to when using union? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Result two content method more statement problem same helpless for this reason multiple instance for this skill operator data article experience industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux Docker Apple Shulou Technology