Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the key points for mysql to use union?

Shulou Source: shulou.com Published: 2022-05-31 10:55:02 09月23日 Update

This article mainly introduces the relevant knowledge of "what are the points for attention in the use of union in mysql". The editor shows you the operation process through an actual case. The method of operation is simple and fast, and it is practical. I hope this article "what are the points for attention in the use of union in mysql" can help you solve the 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';, this is the end of the introduction of "what are the points for attention in using union in mysql". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Tags: Results knowledge two industries statements different practical same content multiple examples practicality practical operators data articles methods more cases knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB OPPO Reno Apple Xiaomi