当前位置:网站首页>sql statement - how to query data in another table based on the data in one table
sql statement - how to query data in another table based on the data in one table
2022-07-31 04:52:00 【jiey0407】
The following is a basic style of SQL statement:
select *from table 2where name in (select namefrom table 1where condition)
Example requirements: It is applied in the project like this: I need to find the bin number placed on the bin location in the bin location information table according to the bin location number, and then I will associate it with the bin number.Find the material in the bin in the bin information table.(The main query process is viewed in (1))
The following is the writing method in mybatis, the writing method of Dao.xml sql statement in mappers
(1) Writing of Dao.xml sql statement in mappers in the example
According to the warehouse_location field in the device_book table to query all the list information related to the workbin_no field, remove the results of multiple repetitions, get >workbin_no field All related list results and then go to the device_workbin table to query all related information.
(2) In the instance In Dao.xml in mappers, it corresponds to the set of all basic fields of the database table.
(3) In the example corresponding to the writing method in Dao.Java
(4) In the example corresponding to the writing in service.Java
(5) In the example corresponding to the writing in serviceImp.Java
(6) In the example corresponding to the writing method in apiController.Java
--------------------------------------There is no text below----------------------------
Note: For learning only, record questions and reference, and encourage each other!
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- MySQL修改root账号密码
- XSS shooting range (3) prompt to win
- Lua,ILRuntime, HybridCLR(wolong)/huatuo热更新对比分析
- 已解决:不小心卸载pip后(手动安装pip的两种方式)
- MySQL开窗函数
- 重磅 | 开放原子校源行活动正式启动
- Reinforcement learning: from entry to pit to shit
- 【debug锦集】Expected input batch_size (1) to match target batch_size (0)
- Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
- Unity打灵狐者
猜你喜欢
【C语言】操作符详解
Error EPERM operation not permitted, mkdir 'Dsoftwarenodejsnode_cache_cacach Two solutions
数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开
[R language] [3] apply, tapply, lapply, sapply, mapply and par function related parameters
强化学习:从入门到入坑再到拉屎
ERP Production Operation Control Kingdee
马斯克对话“虚拟版”马斯克,脑机交互技术离我们有多远
MATLAB/Simulink&&STM32CubeMX工具链完成基于模型的设计开发(MBD)(三)
XSS shooting range (3) prompt to win
Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
随机推荐
Unity教程:URP渲染管线实战教程系列【1】
[Cloud Native] DevOps (5): Integrating Harbor
unity2d小游戏
MATLAB/Simulink & & STM32CubeMX tool chain completes model-based design development (MBD) (three)
[debug highlights] Expected input batch_size (1) to match target batch_size (0)
MySQL事务隔离级别详解
Reinforcement learning: from entry to pit to shit
益智类游戏关卡设计:逆推法--巧解益智类游戏关卡设计
The 15th day of the special assault version of the sword offer
Basic knowledge of mysql (2)
两个地址池r2负责管地址池r1负责管dhcp中继
【ORACLE Explain 详解】
HCIP第十天_BGP路由汇总实验
Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
MySQL修改root账号密码
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
STM32HAL library modifies Hal_Delay to us-level delay
input输入框展示两位小数之precision
三子棋的代码实现