{"id":6830,"date":"2024-11-14T13:22:44","date_gmt":"2024-11-14T05:22:44","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6830\/"},"modified":"2024-11-14T13:22:44","modified_gmt":"2024-11-14T05:22:44","slug":"mysql-join-%e4%b8%b4%e6%97%b6%e8%a1%a8%e5%ad%97%e6%ae%b5%ef%bc%9a%e5%86%85%e8%bf%9e%e6%8e%a5%e6%97%b6%ef%bc%8c%e4%b8%b4%e6%97%b6%e8%a1%a8%e5%ad%97%e6%ae%b5%e4%bc%9a%e5%8c%85%e5%90%ab%e5%93%aa%e4%ba%9b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6830\/","title":{"rendered":"MySQL Join \u4e34\u65f6\u8868\u5b57\u6bb5\uff1a\u5185\u8fde\u63a5\u65f6\uff0c\u4e34\u65f6\u8868\u5b57\u6bb5\u4f1a\u5305\u542b\u54ea\u4e9b\u5185\u5bb9\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172995409670801.jpg\" class=\"aligncenter\" title=\"MySQL Join \u4e34\u65f6\u8868\u5b57\u6bb5\uff1a\u5185\u8fde\u63a5\u65f6\uff0c\u4e34\u65f6\u8868\u5b57\u6bb5\u4f1a\u5305\u542b\u54ea\u4e9b\u5185\u5bb9\uff1f\u63d2\u56fe\" alt=\"MySQL Join \u4e34\u65f6\u8868\u5b57\u6bb5\uff1a\u5185\u8fde\u63a5\u65f6\uff0c\u4e34\u65f6\u8868\u5b57\u6bb5\u4f1a\u5305\u542b\u54ea\u4e9b\u5185\u5bb9\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL Join \u4e34\u65f6\u8868\u5b57\u6bb5\u7591\u7aa6<\/strong><\/p>\n<p>\u5047\u8bbe\u8868 A \u548c\u8868 B \u90fd\u6709 4 \u4e2a\u5b57\u6bb5\u3002\u73b0\u5728\u6267\u884c\u4e00\u6761 SQL \u8bed\u53e5\uff0c\u5c06\u8868 A \u4e0e\u8868 B \u5728 a_id \u5217\u4e0a\u8fdb\u884c\u5185\u8fde\u63a5\uff0c\u5e76\u8fc7\u6ee4\u51fa\u8868 B \u4e2d delete_sign \u4e3a 0 \u7684\u8bb0\u5f55\u3002<\/p>\n<p>\u95ee\u9898\uff1aMySQL \u6267\u884c SQL \u8bed\u53e5\u65f6\u751f\u6210\u7684\u4e34\u65f6\u8868\u5b57\u6bb5\u4f1a\u662f\u4ee5\u4e0b\u54ea\u79cd\u60c5\u51b5\uff1f<\/p>\n<p><strong>\u9009\u9879 A\uff1a\u4e34\u65f6\u8868 M<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>A.id<\/td>\n<\/tr>\n<tr>\n<td>A.name<\/td>\n<\/tr>\n<tr>\n<td>A.staus<\/td>\n<\/tr>\n<tr>\n<td>A.delete_sign<\/td>\n<\/tr>\n<tr>\n<td>B.id<\/td>\n<\/tr>\n<tr>\n<td>B.a_id<\/td>\n<\/tr>\n<tr>\n<td>B.staus<\/td>\n<\/tr>\n<tr>\n<td>B.delete_sign<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u9009\u9879 B\uff1a\u4e34\u65f6\u8868 N<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>\u5b57\u6bb5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>A.id<\/td>\n<\/tr>\n<tr>\n<td>A.name<\/td>\n<\/tr>\n<tr>\n<td>A.staus<\/td>\n<\/tr>\n<tr>\n<td>A.delete_sign<\/td>\n<\/tr>\n<tr>\n<td>B.delete_sign<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7b54\u6848\uff1a<strong>\u4e34\u65f6\u8868 N<\/strong><\/p>\n<p>\u6839\u636e\u5173\u7cfb\u4ee3\u6570\u4e2d\u7684\u81ea\u7136\u8fde\u63a5\u5b9a\u4e49\uff0c\u4e34\u65f6\u8868 N \u662f\u6b63\u786e\u7684\u9009\u62e9\u3002\u4e34\u65f6\u8868 N \u4ec5\u5305\u542b\u8868 A \u548c\u8868 B \u7684\u8fde\u63a5\u5217\uff08\u5373 a_id\uff09\u4ee5\u53ca\u7528\u4e8e\u786e\u5b9a\u8fde\u63a5\u5173\u7cfb\u7684\u8868 B \u4e2d\u7684\u8fc7\u6ee4\u6761\u4ef6\u5b57\u6bb5\uff08\u5373 delete_sign\uff09\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL Join \u4e34\u65f6\u8868\u5b57\u6bb5\uff1a\u5185\u8fde\u63a5\u65f6\uff0c\u4e34\u65f6\u8868\u5b57\u6bb5\u4f1a\u5305\u542b\u54ea\u4e9b\u5185\u5bb9\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL Join \u4e34\u65f6\u8868\u5b57\u6bb5\u7591\u7aa6 \u5047\u8bbe\u8868 A \u548c\u8868 B \u90fd\u6709 4 \u4e2a\u5b57\u6bb5\u3002\u73b0\u5728\u6267\u884c\u4e00\u6761 SQL \u8bed\u53e5\uff0c\u5c06\u8868 A \u4e0e\u8868 B \u5728 a_id \u5217\u4e0a\u8fdb\u884c\u5185\u8fde\u63a5\uff0c\u5e76\u8fc7\u6ee4\u51fa\u8868 B \u4e2d delete_sign \u4e3a 0 \u7684\u8bb0\u5f55\u3002 \u95ee\u9898\uff1aMySQL \u6267\u884c SQL \u8bed\u53e5\u65f6\u751f\u6210\u7684\u4e34\u65f6\u8868\u5b57\u6bb5\u4f1a\u662f\u4ee5\u4e0b\u54ea\u79cd\u60c5\u51b5\uff1f \u9009\u9879 A\uff1a\u4e34\u65f6\u8868 M \u5b57\u6bb5 A.id A.name A.staus A.delete_sign B.id B.a_id B.staus B.delete_sign \u9009\u9879 B\uff1a\u4e34\u65f6\u8868 N \u5b57\u6bb5 A.id A.name A.staus A.delete_sign B.delete_sign \u7b54\u6848\uff1a\u4e34\u65f6\u8868 N \u6839\u636e\u5173\u7cfb\u4ee3\u6570\u4e2d\u7684\u81ea\u7136\u8fde\u63a5\u5b9a\u4e49\uff0c\u4e34\u65f6\u8868 N \u662f\u6b63\u786e\u7684\u9009\u62e9\u3002\u4e34\u65f6\u8868 N [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6830","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6830"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6830\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}