当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
day12---接口和协议
The use of the database table structure document generation tool screw
LiveData 记录下 +
VR全景市场拓展技巧之“拓客宝典”
Data warehouse buried point system and attribution practice
集群
【着色器实现HandDrawn简笔画抖动效果_Shader效果第十二篇】
Roson的Qt之旅#104 QML Image控件
boot - SSE
请求与响应:响应
依赖注入(DI),自动配置,集合注入
jolt语法
测试用例设计方法之因果图详解
Poke the myth of Web3?Poke the iron plate.
pyspark---encode the suuid interval (based on the number of exposures and clicks)
ArcEngine(六)用tool工具实现拉框放大缩小和平移
熊市中预言机,牛市中的战斗机,藏宝计划起飞,坐稳扶好!
information_schema
ArcEngine(三)通过MapControl控件实现放大缩小全图漫游
Postman will return to the interface to generate a json file to the local









