{"id":56281,"date":"2025-08-14T16:04:44","date_gmt":"2025-08-14T08:04:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/56281.html"},"modified":"2025-08-14T16:04:44","modified_gmt":"2025-08-14T08:04:44","slug":"%e5%85%b3%e7%b3%bb%e5%9e%8b%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%ad%e7%9a%84%e5%85%b3%e8%81%94%e5%85%b3%e7%b3%bb%e4%b8%8e%e5%85%b3%e8%81%94%e6%9f%a5%e8%af%a2%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/56281.html","title":{"rendered":"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E8%A1%A8%E4%B8%8E%E8%A1%A8%E7%9A%84%E5%85%B3%E8%81%94%E5%85%B3%E7%B3%BB%EF%BC%9A%E6%95%B0%E6%8D%AE%E8%BF%9E%E6%8E%A5%E7%9A%84%E5%9F%BA%E7%9F%B3-toc\" style=\"margin-left:40px\">\u4e00\u3001\u8868\u4e0e\u8868\u7684\u5173\u8054\u5173\u7cfb&#xff1a;\u6570\u636e\u8fde\u63a5\u7684\u57fa\u77f3<\/p>\n<p id=\"1.1%20%E4%B8%80%E5%AF%B9%E4%B8%80%E5%85%B3%E7%B3%BB-toc\" style=\"margin-left:80px\">1.1 \u4e00\u5bf9\u4e00\u5173\u7cfb<\/p>\n<p id=\"1.2%20%E4%B8%80%E5%AF%B9%E5%A4%9A%E5%85%B3%E7%B3%BB-toc\" style=\"margin-left:80px\">1.2 \u4e00\u5bf9\u591a\u5173\u7cfb<\/p>\n<p id=\"1.3%20%E5%A4%9A%E5%AF%B9%E5%A4%9A%E5%85%B3%E7%B3%BB-toc\" style=\"margin-left:80px\">1.3 \u591a\u5bf9\u591a\u5173\u7cfb<\/p>\n<p id=\"1.4%20%E8%87%AA%E5%85%B3%E8%81%94%E5%85%B3%E7%B3%BB-toc\" style=\"margin-left:80px\">1.4 \u81ea\u5173\u8054\u5173\u7cfb<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E5%85%B3%E8%81%94%E6%9F%A5%E8%AF%A2%EF%BC%9A%E5%A4%9A%E8%A1%A8%E6%95%B0%E6%8D%AE%E7%9A%84%E8%81%94%E5%90%88%E6%8F%90%E5%8F%96%E2%80%8B-toc\" style=\"margin-left:40px\">\u4e8c\u3001\u5173\u8054\u67e5\u8be2&#xff1a;\u591a\u8868\u6570\u636e\u7684\u8054\u5408\u63d0\u53d6\u200b<\/p>\n<p id=\"2.1%20%E5%86%85%E8%BF%9E%E6%8E%A5%EF%BC%88INNER%20JOIN%EF%BC%89%EF%BC%9A%E5%8F%96%E4%B8%A4%E8%A1%A8%E7%9A%84%E4%BA%A4%E9%9B%86-toc\" style=\"margin-left:80px\">2.1 \u5185\u8fde\u63a5&#xff08;INNER JOIN&#xff09;&#xff1a;\u53d6\u4e24\u8868\u7684\u4ea4\u96c6<\/p>\n<p id=\"2.2%20%E5%B7%A6%E8%BF%9E%E6%8E%A5%EF%BC%88LEFT%20JOIN%EF%BC%89%EF%BC%9A%E4%BF%9D%E7%95%99%E5%B7%A6%E8%A1%A8%E5%85%A8%E9%83%A8%E8%AE%B0%E5%BD%95-toc\" style=\"margin-left:80px\">2.2 \u5de6\u8fde\u63a5&#xff08;LEFT JOIN&#xff09;&#xff1a;\u4fdd\u7559\u5de6\u8868\u5168\u90e8\u8bb0\u5f55<\/p>\n<p id=\"2.3%20%E5%8F%B3%E8%BF%9E%E6%8E%A5%EF%BC%88RIGHT%20JOIN%EF%BC%89%EF%BC%9A%E4%BF%9D%E7%95%99%E5%8F%B3%E8%A1%A8%E5%85%A8%E9%83%A8%E8%AE%B0%E5%BD%95-toc\" style=\"margin-left:80px\">2.3 \u53f3\u8fde\u63a5&#xff08;RIGHT JOIN&#xff09;&#xff1a;\u4fdd\u7559\u53f3\u8868\u5168\u90e8\u8bb0\u5f55<\/p>\n<p id=\"2.4%20%E5%85%A8%E8%BF%9E%E6%8E%A5%EF%BC%88FULL%20JOIN%EF%BC%89%EF%BC%9A%E4%BF%9D%E7%95%99%E4%B8%A4%E8%A1%A8%E5%85%A8%E9%83%A8%E8%AE%B0%E5%BD%95-toc\" style=\"margin-left:80px\">2.4 \u5168\u8fde\u63a5&#xff08;FULL JOIN&#xff09;&#xff1a;\u4fdd\u7559\u4e24\u8868\u5168\u90e8\u8bb0\u5f55<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E6%80%BB%E7%BB%93%E2%80%8B-toc\" style=\"margin-left:40px\">\u4e09\u3001\u603b\u7ed3\u200b<\/p>\n<hr id=\"hr-toc\" \/>\n<p>\u5728\u5173\u7cfb\u578b\u6570\u636e\u5e93&#xff08;RDBMS&#xff09;\u4e2d&#xff0c;\u8868\u4e0e\u8868\u4e4b\u95f4\u7684\u5173\u8054\u5173\u7cfb\u662f\u6570\u636e\u7ec4\u7ec7\u7684\u6838\u5fc3&#xff0c;\u800c\u5173\u8054\u67e5\u8be2\u5219\u662f\u6316\u6398\u591a\u8868\u6570\u636e\u4ef7\u503c\u7684\u5173\u952e\u6280\u672f\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u89e3\u6790\u6570\u636e\u5e93\u4e2d\u5e38\u89c1\u7684\u5173\u8054\u5173\u7cfb\u7c7b\u578b&#xff0c;\u8be6\u89e3\u5173\u8054\u67e5\u8be2\u7684\u5b9e\u73b0\u65b9\u5f0f&#xff0c;\u5e76\u901a\u8fc7\u5b9e\u4f8b\u6f14\u793a\u5176\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u7684\u5e94\u7528\u3002<\/p>\n<h3 id=\"%E4%B8%80%E3%80%81%E8%A1%A8%E4%B8%8E%E8%A1%A8%E7%9A%84%E5%85%B3%E8%81%94%E5%85%B3%E7%B3%BB%EF%BC%9A%E6%95%B0%E6%8D%AE%E8%BF%9E%E6%8E%A5%E7%9A%84%E5%9F%BA%E7%9F%B3\">\u4e00\u3001\u8868\u4e0e\u8868\u7684\u5173\u8054\u5173\u7cfb&#xff1a;\u6570\u636e\u8fde\u63a5\u7684\u57fa\u77f3<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5173\u8054\u5173\u7cfb&#xff08;Relationship&#xff09;\u662f\u6307\u591a\u4e2a\u8868\u4e4b\u95f4\u901a\u8fc7\u5171\u540c\u5b57\u6bb5\u5efa\u7acb\u7684\u903b\u8f91\u8054\u7cfb&#xff0c;\u5176\u672c\u8d28\u662f\u901a\u8fc7\u5916\u952e&#xff08;Foreign Key&#xff09;\u5b9e\u73b0\u6570\u636e\u7684\u53c2\u7167\u5b8c\u6574\u6027\u3002\u6839\u636e\u4e1a\u52a1\u573a\u666f\u7684\u4e0d\u540c&#xff0c;\u5173\u8054\u5173\u7cfb\u53ef\u5206\u4e3a\u4ee5\u4e0b\u56db\u79cd\u7c7b\u578b&#xff1a;<\/p>\n<h4 id=\"1.1%20%E4%B8%80%E5%AF%B9%E4%B8%80%E5%85%B3%E7%B3%BB\">1.1 \u4e00\u5bf9\u4e00\u5173\u7cfb<\/h4>\n<p>\u5b9a\u4e49&#xff1a;\u4e24\u4e2a\u8868\u4e2d&#xff0c;A \u8868\u7684\u4e00\u6761\u8bb0\u5f55\u4ec5\u5bf9\u5e94 B \u8868\u7684\u4e00\u6761\u8bb0\u5f55&#xff0c;\u53cd\u4e4b\u4ea6\u7136\u3002\u200b<\/p>\n<p>\u7279\u5f81&#xff1a;\u901a\u5e38\u7528\u4e8e\u62c6\u5206\u5b57\u6bb5\u8f83\u591a\u7684\u8868&#xff08;\u5982\u5c06\u7528\u6237\u57fa\u672c\u4fe1\u606f\u4e0e\u8be6\u7ec6\u4fe1\u606f\u5206\u79bb&#xff09;&#xff0c;\u901a\u8fc7\u4e3b\u952e\u4e0e\u5916\u952e\u5173\u8054&#xff08;\u5916\u952e\u9700\u6dfb\u52a0\u552f\u4e00\u7ea6\u675fUNIQUE&#xff09;\u3002\u200b<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>&#8212; &#8211;\u4e00\u5bf9\u4e00 CREATE TABLE user_info ( \u00a0 user_id INT PRIMARY KEY not null AUTO_INCREMENT, \u00a0 username VARCHAR(50) NOT NULL UNIQUE, \u00a0 email VARCHAR(100) NOT NULL UNIQUE ); INSERT INTO user_info (username, email) VALUES\u00a0 (&#039;zhangsan&#039;, &#039;zhangsan&#064;qq.com&#039;), (&#039;lisi&#039;, &#039;lisi&#064;qq.com&#039;); CREATE TABLE user_profile ( \u00a0 profile_id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 user_id INT NOT NULL UNIQUE,\u00a0 \u00a0 real_name VARCHAR(50), \u00a0 address VARCHAR(200), \u00a0 CONSTRAINT fk_profile_user FOREIGN KEY (user_id)\u00a0 \u00a0 REFERENCES user_info (user_id)\u00a0 \u00a0 ON DELETE CASCADE\u00a0 );<\/p>\n<p>INSERT INTO user_profile (user_id, real_name, address) VALUES\u00a0 (1, &#039;\u5f20\u4e09&#039;, &#039;\u5317\u4eac\u5e02\u6d77\u6dc0\u533a&#039;), (2, &#039;\u674e\u56db&#039;, &#039;\u4e0a\u6d77\u5e02\u6d66\u4e1c\u65b0\u533a&#039;);<\/p>\n<p>select user_id from user_info where username &#061; &#034;zhangsan&#034;; select real_name from user_profile where user_id &#061;(select user_id from user_info where username &#061; &#034;zhangsan&#034;)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"98\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080440-689d9898281b7.png\" width=\"355\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"145\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080440-689d98987bf78.png\" width=\"820\" \/><\/p>\n<h4 id=\"1.2%20%E4%B8%80%E5%AF%B9%E5%A4%9A%E5%85%B3%E7%B3%BB\">1.2 \u4e00\u5bf9\u591a\u5173\u7cfb<\/h4>\n<p>\u5b9a\u4e49&#xff1a;A \u8868\u7684\u4e00\u6761\u8bb0\u5f55\u53ef\u5bf9\u5e94 B \u8868\u7684\u591a\u6761\u8bb0\u5f55&#xff0c;\u4f46 B \u8868\u7684\u4e00\u6761\u8bb0\u5f55\u4ec5\u5bf9\u5e94 A \u8868\u7684\u4e00\u6761\u8bb0\u5f55\u3002\u200b<\/p>\n<p>\u7279\u5f81&#xff1a;\u6700\u5e38\u89c1\u7684\u5173\u8054\u5173\u7cfb&#xff0c;\u901a\u8fc7 \u201c\u4e00\u201d \u4fa7\u8868\u7684\u4e3b\u952e\u4e0e \u201c\u591a\u201d \u4fa7\u8868\u7684\u5916\u952e\u5173\u8054&#xff08;\u5916\u952e\u65e0\u552f\u4e00\u7ea6\u675f&#xff09;\u3002\u200b<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>&#8212; \u4e00\u5bf9\u591a CREATE TABLE department ( \u00a0 dept_id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 dept_name VARCHAR(50) NOT NULL UNIQUE, \u00a0 location VARCHAR(100) ); INSERT INTO department (dept_name, location) VALUES\u00a0 (&#039;\u7814\u53d1\u90e8&#039;, &#039;\u529e\u516c\u697cA\u5ea7&#039;), (&#039;\u5e02\u573a\u90e8&#039;, &#039;\u529e\u516c\u697cB\u5ea7&#039;); CREATE TABLE employee ( \u00a0 emp_id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 emp_name VARCHAR(50) NOT NULL, \u00a0 dept_id INT,\u00a0 \u00a0 salary DECIMAL(10,2), &#8212;\u00a0 \u00a0 CONSTRAINT fk_emp_dept FOREIGN KEY (dept_id)\u00a0 \u00a0 REFERENCES department (dept_id)\u00a0 \u00a0 ON DELETE SET NULL \u00a0 ); INSERT INTO employee (emp_name, dept_id, salary) VALUES\u00a0 (&#039;zs&#039;, 1, 8000), (&#039;ls&#039;, 1, 9000), (&#039;ww&#039;, 2, 7500); &#8212; SELECT d.dept_name, e.emp_name, e.salary\u00a0 FROM &#096;department&#096; d JOIN &#096;employee&#096; e ON d.dept_id &#061; e.dept_id WHERE d.dept_name &#061; &#039;\u7814\u53d1\u90e8&#039;;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"139\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080440-689d9898b2616.png\" width=\"309\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"208\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080440-689d9898dfedf.png\" width=\"375\" \/><\/p>\n<h4 id=\"1.3%20%E5%A4%9A%E5%AF%B9%E5%A4%9A%E5%85%B3%E7%B3%BB\">1.3 \u591a\u5bf9\u591a\u5173\u7cfb<\/h4>\n<p>\u5b9a\u4e49&#xff1a;A \u8868\u7684\u4e00\u6761\u8bb0\u5f55\u53ef\u5bf9\u5e94 B \u8868\u7684\u591a\u6761\u8bb0\u5f55&#xff0c;\u53cd\u4e4b B \u8868\u7684\u4e00\u6761\u8bb0\u5f55\u4e5f\u53ef\u5bf9\u5e94 A \u8868\u7684\u591a\u6761\u8bb0\u5f55\u3002\u200b<\/p>\n<p>\u7279\u5f81&#xff1a;\u9700\u901a\u8fc7 \u201c\u4e2d\u95f4\u8868\u201d \u5b9e\u73b0\u5173\u8054&#xff0c;\u4e2d\u95f4\u8868\u5305\u542b\u4e24\u4e2a\u5916\u952e&#xff0c;\u5206\u522b\u5173\u8054\u4e24\u4e2a\u8868\u7684\u4e3b\u952e\u3002\u200b<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>&#8212; \u591a\u5bf9\u591a CREATE TABLE products ( \u00a0 \u00a0 product_id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 \u00a0 product_name VARCHAR(100) NOT NULL, \u00a0 \u00a0 price DECIMAL(10,2) NOT NULL ); INSERT INTO products (product_name, price) VALUES (&#039;\u7b14\u8bb0\u672c\u7535\u8111&#039;, 5999.99), (&#039;\u673a\u68b0\u952e\u76d8&#039;, 299.99), (&#039;\u9f20\u6807&#039;, 99.99), (&#039;\u8033\u673a&#039;, 799.99); CREATE TABLE orders ( \u00a0 \u00a0 order_id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 \u00a0 order_number VARCHAR(50) NOT NULL UNIQUE,\u00a0 \u00a0 \u00a0 customer_name VARCHAR(50) NOT NULL ); INSERT INTO orders (order_number, customer_name) VALUES (&#039;ORD2023001&#039;, &#039;\u5f20\u4e09&#039;), (&#039;ORD2023002&#039;, &#039;\u674e\u56db&#039;); CREATE TABLE order_products ( \u00a0 \u00a0 id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 \u00a0 order_id INT NOT NULL, \u00a0 \u00a0 product_id INT NOT NULL, \u00a0 \u00a0 quantity INT NOT NULL,\u00a0 \u00a0 \u00a0 unit_price DECIMAL(10,2) NOT NULL,\u00a0 \u00a0 \u00a0 CONSTRAINT fk_order\u00a0 \u00a0 \u00a0 FOREIGN KEY (order_id)\u00a0 \u00a0 \u00a0 REFERENCES orders(order_id) \u00a0 \u00a0 ON DELETE CASCADE, \u00a0 \u00a0 CONSTRAINT fk_product\u00a0 \u00a0 \u00a0 FOREIGN KEY (product_id)\u00a0 \u00a0 \u00a0 REFERENCES products(product_id) \u00a0 \u00a0 ON DELETE CASCADE, \u00a0 \u00a0\u00a0 \u00a0 \u00a0 UNIQUE KEY uk_order_product (order_id, product_id) ); INSERT INTO order_products (order_id, product_id, quantity, unit_price) VALUES (1, 1, 1, 5999.99),\u00a0 (1, 2, 1, 299.99), (1, 3, 1, 99.99), \u00a0 (2, 2, 2, 299.99), \u00a0 (2, 4, 1, 799.99); SELECT o.order_number,p.product_name,op.quantity FROM orders o JOIN order_products op ON o.order_id &#061; op.order_id JOIN products p ON op.product_id &#061; p.product_id WHERE o.order_number &#061; &#039;ORD2023001&#039;;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"181\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080441-689d98991ef37.png\" width=\"330\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"226\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080441-689d989976ffe.png\" width=\"509\" \/><\/p>\n<h4 id=\"1.4%20%E8%87%AA%E5%85%B3%E8%81%94%E5%85%B3%E7%B3%BB\">1.4 \u81ea\u5173\u8054\u5173\u7cfb<\/h4>\n<p>\u5b9a\u4e49&#xff1a;\u8868\u4e2d\u7684\u5b57\u6bb5\u5173\u8054\u540c\u8868\u4e2d\u7684\u5176\u4ed6\u5b57\u6bb5&#xff0c;\u7528\u4e8e\u8868\u793a\u5c42\u7ea7\u6216\u9012\u5f52\u5173\u7cfb\u3002\u200b<\/p>\n<p>\u7279\u5f81&#xff1a;\u5916\u952e\u6307\u5411\u81ea\u8eab\u8868\u7684\u4e3b\u952e&#xff0c;\u5e38\u7528\u4e8e\u6784\u5efa\u6811\u5f62\u7ed3\u6784&#xff08;\u5982\u7ec4\u7ec7\u67b6\u6784\u3001\u8bc4\u8bba\u56de\u590d&#xff09;\u3002\u200b<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>&#8212; &#8211;\u81ea\u5173\u8054 CREATE TABLE person ( \u00a0 \u00a0 id INT NOT NULL AUTO_INCREMENT, \u00a0 \u00a0 name VARCHAR(10) NOT NULL, \u00a0 \u00a0 parent_id INT, \u00a0 \u00a0 PRIMARY KEY (id), \u00a0 \u00a0 FOREIGN KEY (parent_id) REFERENCES person(id) \u00a0 ); INSERT INTO &#096;teacher&#096;.&#096;person&#096;(&#096;id&#096;, &#096;name&#096;, &#096;parent_id&#096;) VALUES (1, &#039;p1&#039;, NULL); INSERT INTO &#096;teacher&#096;.&#096;person&#096;(&#096;id&#096;, &#096;name&#096;, &#096;parent_id&#096;) VALUES (2, &#039; p2&#039;, NULL); INSERT INTO &#096;teacher&#096;.&#096;person&#096;(&#096;id&#096;, &#096;name&#096;, &#096;parent_id&#096;) VALUES (3, &#039;p11&#039;, 1); INSERT INTO &#096;teacher&#096;.&#096;person&#096;(&#096;id&#096;, &#096;name&#096;, &#096;parent_id&#096;) VALUES (4, &#039; p12&#039;, 1); INSERT INTO &#096;teacher&#096;.&#096;person&#096;(&#096;id&#096;, &#096;name&#096;, &#096;parent_id&#096;) VALUES (5, &#039;p21&#039;, 2); INSERT INTO &#096;teacher&#096;.&#096;person&#096;(&#096;id&#096;, &#096;name&#096;, &#096;parent_id&#096;) VALUES (6, &#039; p22&#039;, 2);<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"212\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080441-689d9899e11cf.png\" width=\"235\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"188\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080442-689d989a3ea99.png\" width=\"656\" \/><\/p>\n<\/p>\n<h3 id=\"%E4%BA%8C%E3%80%81%E5%85%B3%E8%81%94%E6%9F%A5%E8%AF%A2%EF%BC%9A%E5%A4%9A%E8%A1%A8%E6%95%B0%E6%8D%AE%E7%9A%84%E8%81%94%E5%90%88%E6%8F%90%E5%8F%96%E2%80%8B\">\u4e8c\u3001\u5173\u8054\u67e5\u8be2&#xff1a;\u591a\u8868\u6570\u636e\u7684\u8054\u5408\u63d0\u53d6\u200b<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5173\u8054\u67e5\u8be2&#xff08;Join Query&#xff09;\u662f\u901a\u8fc7\u5173\u8054\u6761\u4ef6\u5c06\u591a\u4e2a\u8868\u7684\u8bb0\u5f55\u7ec4\u5408\u8d77\u6765\u7684\u67e5\u8be2\u65b9\u5f0f&#xff0c;\u6838\u5fc3\u662f\u4f7f\u7528JOIN\u5173\u952e\u5b57\u8fde\u63a5\u8868&#xff0c;\u5e76\u901a\u8fc7ON\u5b50\u53e5\u6307\u5b9a\u5173\u8054\u6761\u4ef6\u3002\u6839\u636e\u5bf9 \u201c\u4e0d\u5339\u914d\u8bb0\u5f55\u201d \u7684\u5904\u7406\u65b9\u5f0f&#xff0c;\u5173\u8054\u67e5\u8be2\u53ef\u5206\u4e3a\u4ee5\u4e0b\u56db\u7c7b&#xff1a;<\/p>\n<h4 id=\"2.1%20%E5%86%85%E8%BF%9E%E6%8E%A5%EF%BC%88INNER%20JOIN%EF%BC%89%EF%BC%9A%E5%8F%96%E4%B8%A4%E8%A1%A8%E7%9A%84%E4%BA%A4%E9%9B%86\">2.1 \u5185\u8fde\u63a5&#xff08;INNER JOIN&#xff09;&#xff1a;\u53d6\u4e24\u8868\u7684\u4ea4\u96c6<\/h4>\n<p>\u4f5c\u7528&#xff1a;\u4ec5\u8fd4\u56de\u4e24\u4e2a\u8868\u4e2d\u6ee1\u8db3\u5173\u8054\u6761\u4ef6\u7684\u8bb0\u5f55&#xff08;\u5373 \u201c\u5339\u914d\u7684\u4ea4\u96c6\u201d&#xff09;\u3002<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>CREATE TABLE light(id INT NOT NULL auto_increment PRIMARY KEY, name VARCHAR(20) NOT NULL, size INT NOT NULL DEFAULT 1.2, des VARCHAR(500) );<\/p>\n<p>INSERT INTO light (name,size,des) VALUES\u00a0 (&#034;\u957f\u706f&#034;,1.5,NULL), (&#034;\u957f\u6761\u5438\u9876\u706f&#034;,2.0,NULL), (&#034;\u65e5\u5149\u706f\u7ba1&#034;,1.2,NULL), (&#034;\u957f\u706f&#034;,1.5,NULL), (&#034;\u666f\u89c2\u957f\u706f&#034;,1.3,NULL), (&#034;\u65e5\u5149\u706f\u7ba1&#034;,1.6,NULL);<\/p>\n<p>CREATE TABLE light_category ( \u00a0 \u00a0 category_id INT PRIMARY KEY AUTO_INCREMENT, \u00a0 \u00a0 category_name VARCHAR(50) NOT NULL,\u00a0 \u00a0 \u00a0 description VARCHAR(200)\u00a0 );<\/p>\n<p>ALTER TABLE light\u00a0 ADD COLUMN category_id INT, ADD CONSTRAINT fk_light_category\u00a0 FOREIGN KEY (category_id) REFERENCES light_category(category_id);<\/p>\n<p>INSERT INTO light_category (category_name, description) VALUES (&#039;\u5bb6\u5c45\u957f\u706f&#039;, &#039;\u5bb6\u5ead\u4f7f\u7528\u7684\u957f\u6761\u5f62\u706f\u5177&#039;), (&#039;\u5546\u7528\u957f\u706f&#039;, &#039;\u516c\u5171\u573a\u6240\u4f7f\u7528\u7684\u957f\u6761\u5f62\u706f\u5177&#039;), (&#039;\u6237\u5916\u957f\u706f&#039;, &#039;\u5ba4\u5916\u73af\u5883\u4f7f\u7528\u7684\u957f\u6761\u5f62\u706f\u5177&#039;);<\/p>\n<p>select l.id,l.name,l.size,c.category_name from \u00a0light l inner join light_category c on l.category_id &#061; c.category_id;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"187\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080442-689d989a71f24.png\" width=\"388\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"170\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080442-689d989abb714.png\" width=\"426\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"153\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080442-689d989adcc8f.png\" width=\"795\" \/><\/p>\n<h4 id=\"2.2%20%E5%B7%A6%E8%BF%9E%E6%8E%A5%EF%BC%88LEFT%20JOIN%EF%BC%89%EF%BC%9A%E4%BF%9D%E7%95%99%E5%B7%A6%E8%A1%A8%E5%85%A8%E9%83%A8%E8%AE%B0%E5%BD%95\">2.2 \u5de6\u8fde\u63a5&#xff08;LEFT JOIN&#xff09;&#xff1a;\u4fdd\u7559\u5de6\u8868\u5168\u90e8\u8bb0\u5f55<\/h4>\n<p>\u4f5c\u7528&#xff1a;\u8fd4\u56de\u5de6\u8868\u7684\u6240\u6709\u8bb0\u5f55&#xff0c;\u4ee5\u53ca\u53f3\u8868\u4e2d\u6ee1\u8db3\u5173\u8054\u6761\u4ef6\u7684\u8bb0\u5f55&#xff08;\u53f3\u8868\u65e0\u5339\u914d\u5219\u663e\u793aNULL&#xff09;\u3002<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>select l.id,l.name,l.size,c.category_name from \u00a0light l left join light_category c on l.category_id &#061; c.category_id;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"266\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080443-689d989b07479.png\" width=\"752\" \/><\/p>\n<h4 id=\"2.3%20%E5%8F%B3%E8%BF%9E%E6%8E%A5%EF%BC%88RIGHT%20JOIN%EF%BC%89%EF%BC%9A%E4%BF%9D%E7%95%99%E5%8F%B3%E8%A1%A8%E5%85%A8%E9%83%A8%E8%AE%B0%E5%BD%95\">2.3 \u53f3\u8fde\u63a5&#xff08;RIGHT JOIN&#xff09;&#xff1a;\u4fdd\u7559\u53f3\u8868\u5168\u90e8\u8bb0\u5f55<\/h4>\n<p>\u4f5c\u7528&#xff1a;\u8fd4\u56de\u53f3\u8868\u7684\u6240\u6709\u8bb0\u5f55&#xff0c;\u4ee5\u53ca\u5de6\u8868\u4e2d\u6ee1\u8db3\u5173\u8054\u6761\u4ef6\u7684\u8bb0\u5f55&#xff08;\u5de6\u8868\u65e0\u5339\u914d\u5219\u663e\u793aNULL&#xff09;\u3002<\/p>\n<p>\u5b9e\u4f8b&#xff1a;<\/p>\n<p>select l.id,l.name,l.size,c.category_name from \u00a0light l right join light_category c on l.category_id &#061; c.category_id;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"197\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080443-689d989b25c3d.png\" width=\"814\" \/><\/p>\n<h4 id=\"2.4%20%E5%85%A8%E8%BF%9E%E6%8E%A5%EF%BC%88FULL%20JOIN%EF%BC%89%EF%BC%9A%E4%BF%9D%E7%95%99%E4%B8%A4%E8%A1%A8%E5%85%A8%E9%83%A8%E8%AE%B0%E5%BD%95\">2.4 \u5168\u8fde\u63a5&#xff08;FULL JOIN&#xff09;&#xff1a;\u4fdd\u7559\u4e24\u8868\u5168\u90e8\u8bb0\u5f55<\/h4>\n<p>\u4f5c\u7528&#xff1a;\u8fd4\u56de\u5de6\u8868\u548c\u53f3\u8868\u7684\u6240\u6709\u8bb0\u5f55&#xff0c;\u4e24\u8868\u4e2d\u65e0\u5339\u914d\u7684\u90e8\u5206\u5747\u663e\u793aNULL\u3002<\/p>\n<p>\u8bf4\u660e&#xff1a;MySQL \u4e0d\u76f4\u63a5\u652f\u6301FULL JOIN&#xff0c;\u9700\u901a\u8fc7LEFT JOIN\u4e0eRIGHT JOIN\u7684\u7ed3\u679c\u8054\u5408&#xff08;UNION&#xff09;\u5b9e\u73b0\u3002<\/p>\n<p>select l.id,l.name,l.size,c.category_name from \u00a0light l left join light_category c on l.category_id &#061; c.category_id and select l.id,l.name,l.size,c.category_name from \u00a0light l right join light_category c on l.category_id &#061; c.category_id;<\/p>\n<h3 id=\"%E4%B8%89%E3%80%81%E6%80%BB%E7%BB%93%E2%80%8B\">\u4e09\u3001\u603b\u7ed3\u200b<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5173\u8054\u5173\u7cfb\u662f\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u6838\u5fc3\u8bbe\u8ba1\u601d\u60f3&#xff0c;\u4e00\u5bf9\u4e00\u3001\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u591a\u548c\u81ea\u5f15\u7528\u5173\u7cfb\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684\u4e1a\u52a1\u573a\u666f&#xff0c;\u5176\u4e2d\u4e00\u5bf9\u591a\u548c\u591a\u5bf9\u591a\u6700\u4e3a\u5e38\u89c1&#xff08;\u591a\u5bf9\u591a\u9700\u901a\u8fc7\u4e2d\u95f4\u8868\u5b9e\u73b0&#xff09;\u3002\u200b<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5173\u8054\u67e5\u8be2\u901a\u8fc7INNER JOIN\u3001LEFT JOIN\u7b49\u65b9\u5f0f\u5b9e\u73b0\u591a\u8868\u6570\u636e\u7684\u8054\u5408\u63d0\u53d6&#xff0c;\u5173\u952e\u662f\u660e\u786e \u201c\u4fdd\u7559\u54ea\u4e9b\u8868\u7684\u8bb0\u5f55\u201d \u4ee5\u53ca \u201c\u5982\u4f55\u5173\u8054\u5b57\u6bb5\u201d\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u9700\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5173\u8054\u7c7b\u578b&#xff0c;\u5e76\u901a\u8fc7\u7d22\u5f15\u4f18\u5316\u3001\u6761\u4ef6\u7b5b\u9009\u7b49\u65b9\u5f0f\u63d0\u5347\u67e5\u8be2\u6027\u80fd\u3002\u200b<\/p>\n<p>\u638c\u63e1\u5173\u8054\u5173\u7cfb\u8bbe\u8ba1\u4e0e\u5173\u8054\u67e5\u8be2\u6280\u5de7&#xff0c;\u662f\u6784\u5efa\u9ad8\u6548\u3001\u6e05\u6670\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u57fa\u7840&#xff0c;\u4e5f\u662f\u5904\u7406\u590d\u6742\u4e1a\u52a1\u6570\u636e\u7684\u5fc5\u5907\u80fd\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb153\u6b21\u3002\u5173\u8054\u5173\u7cfb\u662f\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u6838\u5fc3\u8bbe\u8ba1\u601d\u60f3\uff0c\u4e00\u5bf9\u4e00\u3001\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u591a\u548c\u81ea\u5f15\u7528\u5173\u7cfb\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u5176\u4e2d\u4e00\u5bf9\u591a\u548c\u591a\u5bf9\u591a\u6700\u4e3a\u5e38\u89c1\uff08\u591a\u5bf9\u591a\u9700\u901a\u8fc7\u4e2d\u95f4\u8868\u5b9e\u73b0\uff09\u3002\u200b\u5173\u8054\u67e5\u8be2\u901a\u8fc7INNER JOIN\u3001LEFT JOIN\u7b49\u65b9\u5f0f\u5b9e\u73b0\u591a\u8868\u6570\u636e\u7684\u8054\u5408\u63d0\u53d6\uff0c\u5173\u952e\u662f\u660e\u786e \u201c\u4fdd\u7559\u54ea\u4e9b\u8868\u7684\u8bb0\u5f55\u201d \u4ee5\u53ca \u201c\u5982\u4f55\u5173\u8054\u5b57\u6bb5\u201d\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u9700\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5173\u8054\u7c7b\u578b\uff0c\u5e76\u901a\u8fc7\u7d22\u5f15\u4f18\u5316\u3001\u6761\u4ef6\u7b5b\u9009\u7b49\u65b9\u5f0f\u63d0\u5347\u67e5\u8be2\u6027\u80fd\u3002\u200b\u638c\u63e1\u5173\u8054\u5173\u7cfb\u8bbe\u8ba1\u4e0e\u5173\u8054\u67e5\u8be2\u6280\u5de7\uff0c\u662f\u6784\u5efa\u9ad8\u6548\u3001\u6e05\u6670\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u57fa\u7840\uff0c\u4e5f\u662f\u5904\u7406\u590d\u6742\u4e1a\u52a1\u6570\u636e\u7684\u5fc5\u5907\u80fd\u529b\u3002<\/p>\n","protected":false},"author":2,"featured_media":56268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[100],"topic":[],"class_list":["post-56281","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/56281.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb153\u6b21\u3002\u5173\u8054\u5173\u7cfb\u662f\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u6838\u5fc3\u8bbe\u8ba1\u601d\u60f3\uff0c\u4e00\u5bf9\u4e00\u3001\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u591a\u548c\u81ea\u5f15\u7528\u5173\u7cfb\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u5176\u4e2d\u4e00\u5bf9\u591a\u548c\u591a\u5bf9\u591a\u6700\u4e3a\u5e38\u89c1\uff08\u591a\u5bf9\u591a\u9700\u901a\u8fc7\u4e2d\u95f4\u8868\u5b9e\u73b0\uff09\u3002\u200b\u5173\u8054\u67e5\u8be2\u901a\u8fc7INNER JOIN\u3001LEFT JOIN\u7b49\u65b9\u5f0f\u5b9e\u73b0\u591a\u8868\u6570\u636e\u7684\u8054\u5408\u63d0\u53d6\uff0c\u5173\u952e\u662f\u660e\u786e \u201c\u4fdd\u7559\u54ea\u4e9b\u8868\u7684\u8bb0\u5f55\u201d \u4ee5\u53ca \u201c\u5982\u4f55\u5173\u8054\u5b57\u6bb5\u201d\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u9700\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5173\u8054\u7c7b\u578b\uff0c\u5e76\u901a\u8fc7\u7d22\u5f15\u4f18\u5316\u3001\u6761\u4ef6\u7b5b\u9009\u7b49\u65b9\u5f0f\u63d0\u5347\u67e5\u8be2\u6027\u80fd\u3002\u200b\u638c\u63e1\u5173\u8054\u5173\u7cfb\u8bbe\u8ba1\u4e0e\u5173\u8054\u67e5\u8be2\u6280\u5de7\uff0c\u662f\u6784\u5efa\u9ad8\u6548\u3001\u6e05\u6670\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u57fa\u7840\uff0c\u4e5f\u662f\u5904\u7406\u590d\u6742\u4e1a\u52a1\u6570\u636e\u7684\u5fc5\u5907\u80fd\u529b\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/56281.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-14T08:04:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080440-689d9898281b7.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/56281.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/56281.html\",\"name\":\"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-14T08:04:44+00:00\",\"dateModified\":\"2025-08-14T08:04:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/56281.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/56281.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/56281.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/56281.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb153\u6b21\u3002\u5173\u8054\u5173\u7cfb\u662f\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u6838\u5fc3\u8bbe\u8ba1\u601d\u60f3\uff0c\u4e00\u5bf9\u4e00\u3001\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u591a\u548c\u81ea\u5f15\u7528\u5173\u7cfb\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684\u4e1a\u52a1\u573a\u666f\uff0c\u5176\u4e2d\u4e00\u5bf9\u591a\u548c\u591a\u5bf9\u591a\u6700\u4e3a\u5e38\u89c1\uff08\u591a\u5bf9\u591a\u9700\u901a\u8fc7\u4e2d\u95f4\u8868\u5b9e\u73b0\uff09\u3002\u200b\u5173\u8054\u67e5\u8be2\u901a\u8fc7INNER JOIN\u3001LEFT JOIN\u7b49\u65b9\u5f0f\u5b9e\u73b0\u591a\u8868\u6570\u636e\u7684\u8054\u5408\u63d0\u53d6\uff0c\u5173\u952e\u662f\u660e\u786e \u201c\u4fdd\u7559\u54ea\u4e9b\u8868\u7684\u8bb0\u5f55\u201d \u4ee5\u53ca \u201c\u5982\u4f55\u5173\u8054\u5b57\u6bb5\u201d\u3002\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u9700\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5173\u8054\u7c7b\u578b\uff0c\u5e76\u901a\u8fc7\u7d22\u5f15\u4f18\u5316\u3001\u6761\u4ef6\u7b5b\u9009\u7b49\u65b9\u5f0f\u63d0\u5347\u67e5\u8be2\u6027\u80fd\u3002\u200b\u638c\u63e1\u5173\u8054\u5173\u7cfb\u8bbe\u8ba1\u4e0e\u5173\u8054\u67e5\u8be2\u6280\u5de7\uff0c\u662f\u6784\u5efa\u9ad8\u6548\u3001\u6e05\u6670\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u7684\u57fa\u7840\uff0c\u4e5f\u662f\u5904\u7406\u590d\u6742\u4e1a\u52a1\u6570\u636e\u7684\u5fc5\u5907\u80fd\u529b\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/56281.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-14T08:04:44+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814080440-689d9898281b7.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/56281.html","url":"https:\/\/www.wsisp.com\/helps\/56281.html","name":"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-14T08:04:44+00:00","dateModified":"2025-08-14T08:04:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/56281.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/56281.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/56281.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u7684\u5173\u8054\u5173\u7cfb\u4e0e\u5173\u8054\u67e5\u8be2\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/56281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=56281"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/56281\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/56268"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=56281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=56281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=56281"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=56281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}