{"id":27857,"date":"2024-11-24T14:40:47","date_gmt":"2024-11-24T06:40:47","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27857\/"},"modified":"2024-11-24T14:40:47","modified_gmt":"2024-11-24T06:40:47","slug":"sqlite%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%ad%e5%a6%82%e4%bd%95%e5%85%b3%e8%81%94%e4%b8%a4%e4%b8%aa%e8%a1%a8%e5%b9%b6%e6%a0%b9%e6%8d%ae%e4%b8%bb%e9%94%ae%e6%9f%a5%e8%af%a2%e7%9b%b8%e5%85%b3%e8%ae%b0-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27857\/","title":{"rendered":"SQLite\u6570\u636e\u5e93\u4e2d\u5982\u4f55\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u76f8\u5173\u8bb0\u5f55\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173132425543376.jpg\" class=\"aligncenter\" title=\"SQLite\u6570\u636e\u5e93\u4e2d\u5982\u4f55\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u76f8\u5173\u8bb0\u5f55\uff1f\u63d2\u56fe\" alt=\"SQLite\u6570\u636e\u5e93\u4e2d\u5982\u4f55\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u76f8\u5173\u8bb0\u5f55\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e00\u6b21\u67e5\u8be2\u4e2d\u5173\u8054\u4e24\u4e2a\u8868<\/strong><\/p>\n<p>\u5728sqlite\u6570\u636e\u5e93\u4e2d\uff0c\u8981\u4e00\u6b21\u67e5\u8be2\u4e2d\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u51fa\u76f8\u5173\u8bb0\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528sql\u4e2d\u7684join\u8bed\u6cd5\u3002<\/p>\n<p><strong>join\u8bed\u6cd5<\/strong><\/p>\n<p>join\u8bed\u6cd5\u5141\u8bb8\u6839\u636e\u516c\u5171\u5b57\u6bb5\u6216\u5217\u5c06\u4e24\u4e2a\u6216\u66f4\u591a\u4e2a\u8868\u5173\u8054\u8d77\u6765\u3002\u8bed\u6cd5\u4e3a\uff1a<\/p>\n<pre>select *\nfrom table1\njoin table2 on table1.column = table2.column;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<p>\u6309\u7167\u4f60\u7684\u63cf\u8ff0\uff0c\u8868sites\u548csites_item_list\u901a\u8fc7\u5217id\u5173\u8054\u3002\u8981\u67e5\u8be2\u51fasites\u8868\u7684\u8bb0\u5f55\u53ca\u5176\u5173\u8054\u7684sites_item_list\u8bb0\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre>SELECT *\nFROM sites\nINNER JOIN sites_item_list ON sites.id = sites_item_list.id;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u901a\u8fc7join\u8bed\u6cd5\uff0c\u4f60\u53ef\u4ee5\u4e00\u6b21\u67e5\u8be2\u4e2d\u68c0\u7d22\u6765\u81ea\u591a\u4e2a\u8868\u7684\u76f8\u5173\u6570\u636e\uff0c\u4ece\u800c\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSQLite\u6570\u636e\u5e93\u4e2d\u5982\u4f55\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u76f8\u5173\u8bb0\u5f55\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u6b21\u67e5\u8be2\u4e2d\u5173\u8054\u4e24\u4e2a\u8868 \u5728sqlite\u6570\u636e\u5e93\u4e2d\uff0c\u8981\u4e00\u6b21\u67e5\u8be2\u4e2d\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u51fa\u76f8\u5173\u8bb0\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528sql\u4e2d\u7684join\u8bed\u6cd5\u3002 join\u8bed\u6cd5 join\u8bed\u6cd5\u5141\u8bb8\u6839\u636e\u516c\u5171\u5b57\u6bb5\u6216\u5217\u5c06\u4e24\u4e2a\u6216\u66f4\u591a\u4e2a\u8868\u5173\u8054\u8d77\u6765\u3002\u8bed\u6cd5\u4e3a\uff1a select * from table1 join table2 on table1.column = table2.column; \u767b\u5f55\u540e\u590d\u5236 \u793a\u4f8b \u6309\u7167\u4f60\u7684\u63cf\u8ff0\uff0c\u8868sites\u548csites_item_list\u901a\u8fc7\u5217id\u5173\u8054\u3002\u8981\u67e5\u8be2\u51fasites\u8868\u7684\u8bb0\u5f55\u53ca\u5176\u5173\u8054\u7684sites_item_list\u8bb0\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\uff1a SELECT * FROM sites INNER JOIN sites_item_list ON sites.id = sites_item_list.id; \u767b\u5f55\u540e\u590d\u5236 \u901a\u8fc7join\u8bed\u6cd5\uff0c\u4f60\u53ef\u4ee5\u4e00\u6b21\u67e5\u8be2\u4e2d\u68c0\u7d22\u6765\u81ea\u591a\u4e2a\u8868\u7684\u76f8\u5173\u6570\u636e\uff0c\u4ece\u800c\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\u3002 \u4ee5\u4e0a\u5c31\u662fSQLite\u6570\u636e\u5e93\u4e2d\u5982\u4f55\u5173\u8054\u4e24\u4e2a\u8868\u5e76\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u76f8\u5173\u8bb0\u5f55\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-27857","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27857","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=27857"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27857\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}