当前位置:网站首页>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.
边栏推荐
猜你喜欢

如何使用电子邮件营销在五个步骤中增加产品评论

HCIP笔记整理 2022/7/18

Haisi project summary

The use of the database table structure document generation tool screw

PostMan使用,访问路径@RequestMapping

postman将接口返回结果生成json文件到本地

Shell运维开发基础(一)

Data warehouse buried point system and attribution practice

Transformer、BERT、GPT 论文精读笔记

【图像去雾】基于matlab暗通道和非均值滤波图像去雾【含Matlab源码 2011期】
随机推荐
Transformer、BERT、GPT 论文精读笔记
mysql系统变量与状态变量
DSP Trick:向量长度估算
五、《图解HTTP》报文首部和HTTP缓存
薛定谔的对象属性判断
9月考,如何选择靠谱正规的培训机构?
[机缘参悟-59]:《素书》-6-安于礼仪[安礼章第六]
MySQL or使索引失效
Postman will return to results generated CSV file to the local interface
day12---接口和协议
加载properties文件,容器总结
PostMan使用,访问路径@RequestMapping
【图像去噪】基于matlab稀疏表示KSVD图像去噪【含Matlab源码 2016期】
集群
从学生到职场的转变
[Hello World] 二分查找笔记
【第1天】SQL快速入门-基础查询(SQL 小虚竹)
information_schema
ArcEngine(五)用ICommand接口实现放大缩小
VR全景市场拓展技巧之“拓客宝典”