当前位置:网站首页>In MySQL Association query, the foreign key is null. What if the data cannot be found?
In MySQL Association query, the foreign key is null. What if the data cannot be found?
2022-07-05 03:07:00 【CSDN Q & A】
The foreign key is null Can you not associate the table , Change to normal query , Can it be realized ?
Take the answer :
The design concept of foreign key is to reasonably restrict the entry of data , Do not allow illegal data to be entered , When querying , There is no limit .
The data that the subject said cannot be found , Two tables should be directly executed join Caused by association , It is recommended to use left join Associate two tables , Common query ( Be sure to display the data ) The watch , Put it on the left side. , The table to be associated can be placed on the right :
select * from table_1 a left join table_2 b on a.key = b.key
边栏推荐
- Is there any way to change the height of the uinavigationbar in the storyboard without using the UINavigationController?
- Breaking the information cocoon - my method of actively obtaining information - 3
- LeetCode 234. Palindrome linked list
- Class inheritance in C #
- [micro service SCG] 33 usages of filters
- LeetCode 237. Delete nodes in the linked list
- Basic authorization command for Curl
- Hot knowledge of multithreading (I): introduction to ThreadLocal and underlying principles
- 问下,这个ADB mysql支持sqlserver吗?
- Design and implementation of high availability website architecture
猜你喜欢
Acwing game 58 [End]
Avoid material "minefields"! Play with super high conversion rate
Azkaban actual combat
Vb+access hotel service management system
1.五层网络模型
ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
腾讯云,实现图片上传
Zabbix
Why are there fewer and fewer good products produced by big Internet companies such as Tencent and Alibaba?
C file in keil cannot be compiled
随机推荐
Flume配置4——自定义MYSQLSource
Elfk deployment
Pytest (4) - test case execution sequence
Usage scenarios and solutions of ledger sharing
单项框 复选框
Pytest (5) - assertion
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
el-select,el-option下拉选择框
2.常见的请求方法
【微服务|SCG】Filters的33种用法
返回二叉树中两个节点的最低公共祖先
Pytest (4) - test case execution sequence
TCP security of network security foundation
D3js notes
Azkaban实战
Last words record
C file in keil cannot be compiled
ICSI213/IECE213 Data Structures
Comparison of advantages and disadvantages between platform entry and independent deployment
Design of KTV intelligent dimming system based on MCU