当前位置:网站首页>Advanced learning of MySQL -- basics -- multi table query -- joint query

Advanced learning of MySQL -- basics -- multi table query -- joint query

2022-07-07 00:34:00 Magic pig 9898

The joint query

This is very simple
select Field list from surface A …
union [all]
select Field list from surface B …

To put it bluntly , Is to merge the results of multiple queries , Form a new result set .

Precautions for joint query

  • For joint queries , The number of columns in multiple tables must be consistent , The types of fields should also be consistent .
  • union all All the data will be combined directly , and union The merged data will be de duplicated ( surface A And table B It's the same watch , Different conditions , and or It's the same )
原网站

版权声明
本文为[Magic pig 9898]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130957052010.html