当前位置:网站首页>MySQL queries difference sets (missing data) by linking tables based on an associated field
MySQL queries difference sets (missing data) by linking tables based on an associated field
2022-06-13 08:19:00 【Parthenocissus still works】
Occasionally encountered some exceptions in the development process , Need to verify data integrity , See if some related data is missing , for example :
user:

profile:

Above two tables ,user adopt profile_id relation profile Medium id, At the same time, the two tables do not use foreign key Association , When an exception occurs in the program , Or when the business logic is not mandatory , There could be profile Missing data in , It is not easy to view when the amount of data is large ,
At this time, you can find the missing... Through the linked table query profile Corresponding to the data user The data of :
SELECT u.id,u.name,p.age,p.gender,p.height FROM `user` u LEFT JOIN `profile` p ON u.profile_id=p.id WHERE ISNULL(p.id)give the result as follows :

Sometimes data query and correction can be done with .
边栏推荐
- 5. fabric2.2 installation and submission contract (using official demo)
- How about a well-known food material distribution information management system?
- HCIP_ MGRE comprehensive experiment
- How does the BD new tab plug-in log in?
- How to dynamically delete data rows in a table through JS (keep the head)
- Unity exit Editor Mode
- Free file server storage technology
- Web site access excel in IIS
- Document contains question type
- 从零开始-实现JpetStore网站-1-建立项目框架以及项目介绍
猜你喜欢

Effective Go - The Go Programming Language

Edge浏览器使用BdTab新标签页插件(BD新标签页)

学习记录4: einops // cudnn.benchamark=true // hook

es6删除对象的某个属性

Gtk+ programming example on page 115 - simplest progress bar 2 with steps to write GTK program using anjuta

Which is the stronger fresh food distribution and sorting management system?

本地靶场2-文件上传漏洞(三)-网络安全

Start from scratch - implement the jpetstore website -1- establish the project framework and project introduction

Give code vitality -- the way to read code neatly

微服务系统架构搭建一:环境搭建
随机推荐
Dfinity (ICP) development problems and solutions-6
Amino encoding protocol
How does the BD new tab plug-in log in?
Unity exit Editor Mode
Basic operation of dfinity (ICP) development-4
How to use annotations in word
Plane merging (matlab)
Local shooting range 2- file upload vulnerability (III) - Network Security
Dfinity (ICP) identity authentication and ledger quick start-3
How can the small and medium-sized lighting industry make use of the digital transformation to stand out from the encirclement?
ERP basic data concept
Did decentralized digital identity
Operation of simulated examination platform for examination question bank of G3 boiler water treatment operation certificate in 2022
IPFs cluster setup process
[virt-manager]远程管理启动虚拟机时,鼠标飘逸的问题
字符串的逆序与比较
将solidworks建的机器人模型导入到ros中
What software can be used to solve the problems faced by the auto parts industry
疫情之下的远程办公解决方案
HCIP_ OSPF irregular area