当前位置:网站首页>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.
边栏推荐
猜你喜欢
【着色器实现HandDrawn简笔画抖动效果_Shader效果第十二篇】
sqlserver2019安装失败
面试介绍项目经验(转)
Golang协程goroutine的调度与状态变迁分析
【图像去雾】基于matlab暗通道和非均值滤波图像去雾【含Matlab源码 2011期】
Roson的Qt之旅#104 QML Image控件
【OpenCV】 - 显示图像API之imshow()对不同位深度(数据类型)的图像的处理方法
DeFi明斯基时刻:压力测试与启示
The use of the database table structure document generation tool screw
酷雷曼上新6大功能,全景营销持续加码
随机推荐
循环神经网络RNN基础《PyTorch深度学习实践》
控制bean的加载
【着色器实现HandDrawn简笔画抖动效果_Shader效果第十二篇】
mysql5.7服务器The innodb_system data file 'ibdata1' must be writable导致无法启动服务器
CDGA|如何加强数字政府建设?
力扣(LeetCode)214. 打家劫舍 II(2022.08.02)
VR全景市场拓展技巧之“拓客宝典”
Shell运维开发基础(一)
华为设备配置BFD单跳检测二层链路
001-进程与线程
Evaluate:huggingface评价指标模块入门详细介绍
JS函数获取本月的第一天和最后一天
Shell脚本之一键安装mysql
LeetCode 264:丑数
How to choose a reliable and formal training institution for the exam in September?
推荐系统-排序层-特征工程:用户特征、物品特征
第十二天&接口和协议
数据库表结构文档 生成工具screw的使用
千万级别的表分页查询非常慢,怎么办?
mysql的innodb存储引擎和myisam存储引擎的区别