当前位置:网站首页>How does Mysql query two data tables for the same fields in two tables at the same time
How does Mysql query two data tables for the same fields in two tables at the same time
2022-08-03 08:02:00 【Brother Xin who writes python】
Foreword
Assume there are now two data tables
Table 1 is as follows:

Table 2 is as follows:

When both table 1 and table 2 are in mysql at the same time, only their uuid is the same, and other field information is different. Now you need to use sql statement to query the data that meets the requirements according to the uuid. How to do it?
sql statement to query two tables at the same time
Not much nonsense, follow the editor to continue reading
In fact, this kind of demand is still very common in work, but the method is actually very simple, the sql statement is as follows
select a.*, b.* from data table 1 name a, data table 2 name b WHERE a.uuid=b.uuid and a.webname='ChinesePhotovoltaic Industry Association';# Note: a.webname='China Photovoltaic Industry Association' here means that the webname field in data sheet 1 is the data of 'China Photovoltaic Industry Association'Explanation as follows:
Generally, when we query the meeting, we select * from the data table. We need to query two tables here. As the name implies, we use a and b instead (such as a.* b.*), and the data table name is also followed by an a or b,Conditional statements are also followed by a or b.
After the above statement is successfully executed, the data that meets the requirements of the two tables is on one data table.

If you like this article or this article is helpful to you, remember to follow the editor and like it. If you have any questions or needs, please leave a private message.
边栏推荐
猜你喜欢
随机推荐
mysql备份时的快照原理
酷雷曼上新6大功能,全景营销持续加码
mysql5.7服务器The innodb_system data file 'ibdata1' must be writable导致无法启动服务器
华为设备配置BFD单跳检测二层链路
ArcEngine(一)加载矢量数据
训练正常&异常的GAN损失函数loss变化应该是怎么样的
安全狗云原生安全能力全面亮相全球数字经济大会暨ISC互联网安全大会
实时目标检测新高地之#YOLOv7#更快更强的目标检测器
亿流量大考(1):日增上亿数据,把MySQL直接搞宕机了...
SSM整合流程
剑指offer专项突击版第18天
循环神经网络RNN基础《PyTorch深度学习实践》
[ 漏洞复现篇 ] yapi 代码执行 getshell 漏洞复现详解
ArcEngine(六)用tool工具实现拉框放大缩小和平移
Haisi project summary
Data warehouse buried point system and attribution practice
PostMan使用,访问路径@RequestMapping
海思项目总结
标准输入流
【C语言】函数栈帧的创建和销毁详解






![[ 漏洞复现篇 ] yapi 代码执行 getshell 漏洞复现详解](/img/85/a4142689c22492cd898bd8275cd2c5.png)

