当前位置:网站首页>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-30 04:20:00 【geejkse_seff】
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
边栏推荐
- Advanced [C] array to participate in the function pointer
- OA Project Pending Meeting & History Meeting & All Meetings
- 权值线段树+线段树分裂/合并+CF1659D
- 在麒麟V10操作系统上安装MySQL数据库
- Is the end of the universe a bank?Talk about those things about doing software testing in the bank
- 数组和结构体
- 使用EFR32作为Zigbee/Thread的sniffer的用法
- WEB 渗透之信息收集
- sql语句-如何以一个表中的数据为条件据查询另一个表中的数据
- redis分布式锁的原子保证
猜你喜欢

Pytorch framework learning record 2 - the use of TensorBoard

Pytorch framework learning record 7 - convolutional layer

恐造成下一个“千年虫”的闰秒,遭科技巨头们联合抵制

MYSQL 唯一约束

验证addShutdownHook钩子生效

Shell脚本基本编辑规范及变量

在麒麟V10操作系统上安装MySQL数据库

弘玑再度入围Gartner 2022 RPA魔力象限并实现位置大幅跃升

我的Go+语言初体验——祝福留言小系统,让她也可以感受到你的祝福

Based on all volunteers - H and D1 XR806 rare plant monitoring device
随机推荐
Operational configuration: How to run multiple EasyCVR programs as a service in one server?
handler+message【消息机制】
error: The following untracked working tree files would be overwritten by
WEB 渗透之信息收集
【驱动】udev设置GPIO加载后所有者、所属组和权限
Pytorch framework learning record 3 - the use of Transform
MySQL 安装报错的解决方法
数组和结构体
cv2.polylines
代码开源设计实现思路
逆向分析实战2
How does the Snapdragon 7 series chip perform?Reno8 Pro proves a new generation of God U
New interface - API interface for "Taote" keyword search
Shell script basic editing specifications and variables
Pytorch framework learning record 1 - Dataset class code combat
Pytorch框架学习记录3——Transform的使用
【C进阶】数组传参与函数指针
海外多家权威媒体热议波场TRON:为互联网去中心化奠定基础
(redistribute, special comprehensive experiment ospf area)
厦门感芯科技MC3172(1):介绍和环境搭建