当前位置:网站首页>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 .
边栏推荐
- Edge浏览器使用BdTab新标签页插件(BD新标签页)
- ERP basic data Huaxia
- Local shooting range 2- file upload vulnerability (III) - Network Security
- How to dynamically delete data rows in a table through JS (keep the head)
- 学习记录4: einops // cudnn.benchamark=true // hook
- 免费文件服务器储存技术
- How can the small and medium-sized lighting industry make use of the digital transformation to stand out from the encirclement?
- Idea shortcut summary
- STM32CubeMX的下载和安装方式
- Did decentralized digital identity
猜你喜欢
疫情之下的远程办公解决方案
[game theory complete information static game] Nash equilibrium
How to install the bdtab (BD) new tab plug-in in edge browser (Graphic tutorial)
Give code vitality -- the way to read code neatly
How to download and install stm32cubemx
SolidWorks修改工程图中文字字体的方法
汽配行业面临的难题用什么软件帮忙解决呢
HCIP_ OSPF irregular area
[problem record] json decoder. JSONDecodeError:Extra data: line xxx column xxx(char xxxx)
Recognition of COVID-19 based on paddlepaddle
随机推荐
从零开始-实现JpetStore网站-1-建立项目框架以及项目介绍
How about a well-known food material distribution information management system?
Data disorder occurs when the n-th row of the subcomponent list generated by V-for is deleted
17. how to understand multi version concurrency control and read / write sets of fabric smart contracts? (vernacular version)
Idea shortcut summary
Document contains question type
CCNP_ BT static routing
Microservice Project Construction II: database design
[problem record] json decoder. JSONDecodeError:Extra data: line xxx column xxx(char xxxx)
Dfinity (ICP) basic development tutorial-5
判断一个字符串是否由另外一个字符串旋转而来
Web site access excel in IIS
3. deploy the fabric2.2 cluster (use the official demo)
Dfinity (ICP) deployment and development-2
批发商为什么要使用订单系统
适合生鲜批发行业的几种精准接单方式
CCNP_ Bt- Reissue
Motiko basic syntax in dfinity (ICP) -8
Disk C is full? A few simple tips teach you to release and clean up tens of gigabytes of space on the C disk, the most effective way to clean up the C disk
Effective Go - The Go Programming Language