{"id":83624,"date":"2026-07-26T02:38:10","date_gmt":"2026-07-25T18:38:10","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/83624.html"},"modified":"2026-07-26T02:38:10","modified_gmt":"2026-07-25T18:38:10","slug":"%e3%80%90mysql%e3%80%91mysql%e5%ad%a6%e4%b9%a0%e7%9a%84%e4%b8%80%e5%a4%a7%e9%87%8d%e7%82%b9%ef%bc%9a%e5%9f%ba%e6%9c%ac%e6%9f%a5%e8%af%a2%ef%bc%88%e4%b8%8a%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/83624.html","title":{"rendered":"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09"},"content":{"rendered":"<p> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183808-6a65029078236.png\" width=\"200\" height=\"200\" alt=\"\u5934\u50cf\" \/> <\/p>\n<p> <font color=\"#c0392b\">&#x1f3ac; \u4e2a\u4eba\u4e3b\u9875&#xff1a;\u827e\u8389\u4e1d\u52aa\u529b\u7ec3\u5251<\/font><\/p>\n<p> <font color=\"#3498db\">\u2744\u4e13\u680f\u4f20\u9001\u95e8&#xff1a;\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u300b\u300aC\/C&#043;&#043;\u5e72\u8d27\u5206\u4eab&amp;\u5b66\u4e60\u8fc7\u7a0b\u8bb0\u5f55\u300b \u300aLinux\u64cd\u4f5c\u7cfb\u7edf\u7f16\u7a0b\u8be6\u89e3\u300b\u300a\u7b14\u8bd5\/\u9762\u8bd5\u5e38\u89c1\u7b97\u6cd5&#xff1a;\u4ece\u57fa\u7840\u5230\u8fdb\u9636\u300b\u300aPython\u5e72\u8d27\u5206\u4eab\u300b<\/font><\/p>\n<p> <font color=\"7B68EE\" size=\"4\">\u2b50\ufe0f\u4e3a\u5929\u5730\u7acb\u5fc3&#xff0c;\u4e3a\u751f\u6c11\u7acb\u547d&#xff0c;\u4e3a\u5f80\u5723\u7ee7\u7edd\u5b66&#xff0c;\u4e3a\u4e07\u4e16\u5f00\u592a\u5e73 <\/font><\/p>\n<hr \/>\n<p><font color=\"#c0392b\" size=\"4\">&#x1f3ac; \u827e\u8389\u4e1d\u7684\u7b80\u4ecb&#xff1a;<\/font><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183808-6a650290981d7.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>1 ~&gt; \u6570\u636e\u63d2\u5165&#xff08;Create&#xff09;<\/li>\n<li>\n<ul>\n<li>1.1 \u57fa\u7840 INSERT \u63d2\u5165<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>1.2 \u63d2\u5165\u5426\u5219\u66f4\u65b0&#xff08;ON DUPLICATE KEY UPDATE&#xff09;<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>1.3 REPLACE \u66ff\u6362\u63d2\u5165<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>2 ~&gt; SELECT \u68c0\u7d22\u57fa\u7840<\/li>\n<li>\n<ul>\n<li>2.1 \u57fa\u7840\u67e5\u8be2\u5f62\u5f0f<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>2.2 \u8868\u8fbe\u5f0f\u67e5\u8be2\u4e0e\u522b\u540d<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>2.3 \u7ed3\u679c\u53bb\u91cd<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>3 ~&gt; WHERE \u6761\u4ef6\u7b5b\u9009<\/li>\n<li>\n<ul>\n<li>3.1 \u6bd4\u8f83\u8fd0\u7b97\u7b26<\/li>\n<li>3.2 \u903b\u8f91\u8fd0\u7b97\u7b26<\/li>\n<li>3.3 \u6838\u5fc3\u89c4\u5219&#xff1a;WHERE \u4e0d\u53ef\u4f7f\u7528 SELECT \u522b\u540d<\/li>\n<li>\n<ul>\n<li>\u539f\u7406<\/li>\n<li>\u9519\u8bef\u793a\u4f8b<\/li>\n<li>\u6b63\u786e\u5199\u6cd5<\/li>\n<\/ul>\n<\/li>\n<li>3.4 \u7b5b\u9009\u6848\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>4 ~&gt; ORDER BY \u7ed3\u679c\u6392\u5e8f<\/li>\n<li>\n<ul>\n<li>4.1 \u6392\u5e8f\u57fa\u7840<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>4.2 \u591a\u5b57\u6bb5\u6392\u5e8f<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>4.3 \u6392\u5e8f\u4e0e\u522b\u540d<\/li>\n<li>\n<ul>\n<li>\u539f\u7406<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>5 ~&gt; LIMIT \u5206\u9875\u7b5b\u9009<\/li>\n<li>\n<ul>\n<li>5.1 \u4e09\u79cd\u8bed\u6cd5\u5f62\u5f0f<\/li>\n<li>\n<ul>\n<li>\u6982\u5ff5<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<li>5.2 \u5206\u9875\u4e1a\u52a1\u5b9e\u73b0<\/li>\n<li>\n<ul>\n<li>\u901a\u7528\u516c\u5f0f<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>6 ~&gt; \u6838\u5fc3\u539f\u7406&#xff1a;\u5355\u8868 SQL \u6267\u884c\u987a\u5e8f<\/li>\n<li>\n<ul>\n<li>\u903b\u8f91\u6267\u884c\u987a\u5e8f&#xff08;\u4ece\u5148\u5230\u540e&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\u7ed3\u5c3e<\/li>\n<\/ul>\n<hr \/>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183808-6a650290edfa5.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h2>1 ~&gt; \u6570\u636e\u63d2\u5165&#xff08;Create&#xff09;<\/h2>\n<h3>1.1 \u57fa\u7840 INSERT \u63d2\u5165<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>INSERT \u7528\u4e8e\u5411\u8868\u4e2d\u63d2\u5165\u65b0\u884c\u6570\u636e&#xff0c;\u652f\u6301\u6307\u5b9a\u5217\u63d2\u5165\u3001\u5168\u5217\u63d2\u5165\u3001\u591a\u884c\u6279\u91cf\u63d2\u5165&#xff1b;INTO\u5173\u952e\u5b57\u5728 MySQL \u4e2d\u53ef\u7701\u7565&#xff08;\u975e\u6807\u51c6 SQL \u8bed\u6cd5&#xff09;\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p>\u5355\u884c\u6307\u5b9a\u5217\u63d2\u5165<\/p>\n<p><span class=\"token comment\">&#8212; \u4ec5\u5411\u6307\u5b9a\u5217\u63d2\u5165\u6570\u636e&#xff0c;\u672a\u6307\u5b9a\u7684\u5217\u53d6\u9ed8\u8ba4\u503c\u6216NULL<\/span><br \/>\n<span class=\"token keyword\">INSERT<\/span> <span class=\"token keyword\">INTO<\/span> students <span class=\"token punctuation\">(<\/span>id<span class=\"token punctuation\">,<\/span> sn<span class=\"token punctuation\">,<\/span> name<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">VALUES<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">124<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u5173\u7fbd&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5355\u884c\u5168\u5217\u63d2\u5165<\/p>\n<p><span class=\"token comment\">&#8212; \u5fc5\u987b\u4e25\u683c\u5339\u914d\u8868\u5b9a\u4e49\u7684\u5217\u987a\u5e8f&#xff0c;\u4f20\u5165\u6240\u6709\u5217\u7684\u503c<\/span><br \/>\n<span class=\"token keyword\">INSERT<\/span> <span class=\"token keyword\">INTO<\/span> students<br \/>\n<span class=\"token keyword\">VALUES<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">123<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u5f20\u98de&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;4567890&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u591a\u884c\u6279\u91cf\u63d2\u5165<\/p>\n<p><span class=\"token comment\">&#8212; \u5355\u6b21\u63d0\u4ea4\u591a\u884c\u6570\u636e&#xff0c;\u6027\u80fd\u8fdc\u9ad8\u4e8e\u591a\u6b21\u5355\u884c\u63d2\u5165<\/span><br \/>\n<span class=\"token keyword\">INSERT<\/span> <span class=\"token keyword\">INTO<\/span> students <span class=\"token punctuation\">(<\/span>id<span class=\"token punctuation\">,<\/span> sn<span class=\"token punctuation\">,<\/span> name<span class=\"token punctuation\">,<\/span> qq<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">VALUES<\/span><br \/>\n  <span class=\"token punctuation\">(<\/span><span class=\"token number\">13<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">127<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u8bb8\u6538&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;10423456&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token punctuation\">(<\/span><span class=\"token number\">14<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">128<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u8bb8\u891a&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;12333445&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token punctuation\">(<\/span><span class=\"token number\">15<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">129<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u8bf8\u845b\u4eae&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;3213456&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>1.2 \u63d2\u5165\u5426\u5219\u66f4\u65b0&#xff08;ON DUPLICATE KEY UPDATE&#xff09;<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>\u5f53\u63d2\u5165\u6570\u636e\u89e6\u53d1\u4e3b\u952e\u6216\u552f\u4e00\u952e\u51b2\u7a81\u65f6&#xff0c;\u4e0d\u629b\u51fa\u62a5\u9519&#xff0c;\u8f6c\u800c\u6267\u884c UPDATE \u66f4\u65b0\u6307\u5b9a\u5b57\u6bb5\u3002<\/p>\n<ul>\n<li>\u6b63\u5e38\u63d2\u5165&#xff1a;row_count()\u8fd4\u56de 1<\/li>\n<li>\u53d1\u751f\u5b57\u6bb5\u66f4\u65b0&#xff1a;row_count()\u8fd4\u56de 2<\/li>\n<li>\u66f4\u65b0\u503c\u4e0e\u539f\u503c\u5b8c\u5168\u4e00\u81f4&#xff1a;row_count()\u8fd4\u56de 0<\/li>\n<\/ul>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; id&#061;18\u4e3a\u4e3b\u952e&#xff0c;\u82e5\u5df2\u5b58\u5728\u5219\u66f4\u65b0sn\u3001name\u3001qq\u5b57\u6bb5<\/span><br \/>\n<span class=\"token keyword\">INSERT<\/span> <span class=\"token keyword\">INTO<\/span> students <span class=\"token punctuation\">(<\/span>id<span class=\"token punctuation\">,<\/span> sn<span class=\"token punctuation\">,<\/span> name<span class=\"token punctuation\">,<\/span> qq<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">VALUES<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">18<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">134<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u8c82\u8749&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;1112222&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">ON<\/span> <span class=\"token keyword\">DUPLICATE<\/span> <span class=\"token keyword\">KEY<\/span> <span class=\"token keyword\">UPDATE<\/span><br \/>\n  sn <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">134<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  name <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;\u8c82\u8749&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  qq <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;11133333&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u67e5\u770b\u4e0a\u4e00\u6b21DML\u8bed\u53e5\u5f71\u54cd\u7684\u884c\u6570<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> row_count<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>1.3 REPLACE \u66ff\u6362\u63d2\u5165<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>REPLACE INTO\u6267\u884c\u903b\u8f91&#xff1a;<\/p>\n<li>\u5c1d\u8bd5\u63d2\u5165\u6570\u636e&#xff1b;<\/li>\n<li>\u82e5\u65e0\u4e3b\u952e \/ \u552f\u4e00\u952e\u51b2\u7a81&#xff0c;\u76f4\u63a5\u63d2\u5165&#xff08;\u5f71\u54cd 1 \u884c&#xff09;&#xff1b;<\/li>\n<li>\u82e5\u53d1\u751f\u51b2\u7a81&#xff0c;\u5148\u5220\u9664\u65e7\u884c&#xff0c;\u518d\u63d2\u5165\u65b0\u884c&#xff08;\u5f71\u54cd 2 \u884c&#xff0c;\u81ea\u589e ID \u4f1a\u53d1\u751f\u8df3\u8dc3&#xff09;\u3002<\/li>\n<p>\u6838\u5fc3\u533a\u522b&#xff1a;REPLACE \u5305\u542b\u5220\u9664\u884c\u4e3a&#xff0c;\u4f1a\u89e6\u53d1\u5220\u9664\u89e6\u53d1\u5668\u3001\u5f71\u54cd\u5916\u952e\u7ea7\u8054&#xff0c;\u4e0d\u53ef\u4e0eON DUPLICATE KEY UPDATE\u968f\u610f\u6df7\u7528\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; sn\u4e3a\u552f\u4e00\u952e&#xff0c;\u82e5140\u5df2\u5b58\u5728\u5219\u5220\u9664\u65e7\u884c\u540e\u63d2\u5165\u65b0\u884c<\/span><br \/>\n<span class=\"token keyword\">REPLACE<\/span> <span class=\"token keyword\">INTO<\/span> students <span class=\"token punctuation\">(<\/span>sn<span class=\"token punctuation\">,<\/span> name<span class=\"token punctuation\">,<\/span> qq<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">VALUES<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">140<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;\u8bb8\u6538&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;321456213&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h2>2 ~&gt; SELECT \u68c0\u7d22\u57fa\u7840<\/h2>\n<h3>2.1 \u57fa\u7840\u67e5\u8be2\u5f62\u5f0f<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<ul>\n<li>\u5168\u5217\u67e5\u8be2&#xff1a;\u4f7f\u7528*\u8fd4\u56de\u8868\u4e2d\u6240\u6709\u5217&#xff0c;\u751f\u4ea7\u73af\u5883\u5f3a\u70c8\u4e0d\u63a8\u8350&#xff0c;\u4f1a\u589e\u5927\u6570\u636e\u4f20\u8f93\u91cf\u3001\u53ef\u80fd\u5bfc\u81f4\u7d22\u5f15\u5931\u6548\u3002<\/li>\n<li>\u6307\u5b9a\u5217\u67e5\u8be2&#xff1a;\u660e\u786e\u5217\u51fa\u6240\u9700\u5b57\u6bb5&#xff0c;\u6027\u80fd\u66f4\u4f18\u3001\u53ef\u8bfb\u6027\u66f4\u5f3a\u3002<\/li>\n<\/ul>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u5168\u5217\u67e5\u8be2&#xff08;\u4e0d\u63a8\u8350&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">FROM<\/span> exam_result<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u6307\u5b9a\u5217\u67e5\u8be2<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> id<span class=\"token punctuation\">,<\/span> name<span class=\"token punctuation\">,<\/span> math <span class=\"token keyword\">FROM<\/span> exam_result<span class=\"token punctuation\">;<\/span><\/p>\n<h3>2.2 \u8868\u8fbe\u5f0f\u67e5\u8be2\u4e0e\u522b\u540d<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>SELECT \u540e\u652f\u6301\u5b57\u6bb5\u3001\u5e38\u91cf\u3001\u8fd0\u7b97\u8868\u8fbe\u5f0f\u3001\u51fd\u6570&#xff1b;\u53ef\u901a\u8fc7AS\u5173\u952e\u5b57\u4e3a\u5217\u8bbe\u7f6e\u522b\u540d&#xff0c;AS\u53ef\u7701\u7565\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u8ba1\u7b97\u4e09\u79d1\u603b\u5206\u5e76\u8bbe\u7f6e\u522b\u540dtotal<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span><br \/>\n  name<span class=\"token punctuation\">,<\/span><br \/>\n  math<span class=\"token punctuation\">,<\/span><br \/>\n  chinese <span class=\"token operator\">&#043;<\/span> math <span class=\"token operator\">&#043;<\/span> english <span class=\"token keyword\">AS<\/span> total<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u7701\u7565AS\u7684\u522b\u540d\u5199\u6cd5<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span><br \/>\n  name \u59d3\u540d<span class=\"token punctuation\">,<\/span><br \/>\n  math \u6570\u5b66<span class=\"token punctuation\">,<\/span><br \/>\n  chinese <span class=\"token operator\">&#043;<\/span> math <span class=\"token operator\">&#043;<\/span> english \u603b\u5206<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<span class=\"token punctuation\">;<\/span><\/p>\n<h3>2.3 \u7ed3\u679c\u53bb\u91cd<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>DISTINCT\u5bf9\u67e5\u8be2\u7ed3\u679c\u7684\u6307\u5b9a\u5217\u8fdb\u884c\u53bb\u91cd&#xff1b;\u591a\u5217\u65f6\u6309\u591a\u5217\u7ec4\u5408\u503c\u53bb\u91cd\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u5bf9\u6570\u5b66\u6210\u7ee9\u53bb\u91cd&#xff0c;\u76f8\u540c\u5206\u6570\u4ec5\u4fdd\u7559\u4e00\u6761<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token keyword\">DISTINCT<\/span> math <span class=\"token keyword\">FROM<\/span> exam_result<span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h2>3 ~&gt; WHERE \u6761\u4ef6\u7b5b\u9009<\/h2>\n<h3>3.1 \u6bd4\u8f83\u8fd0\u7b97\u7b26<\/h3>\n<table>\n<tr>\u8fd0\u7b97\u7b26\u8bf4\u660e\u6ce8\u610f\u4e8b\u9879<\/tr>\n<tbody>\n<tr>\n<td>&gt;, &gt;&#061;, &lt;, &lt;&#061;<\/td>\n<td>\u5927\u5c0f\u6bd4\u8f83<\/td>\n<td>\u652f\u6301\u6570\u503c\u3001\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td>&#061;<\/td>\n<td>\u7b49\u4e8e<\/td>\n<td>NULL \u4e0d\u5b89\u5168&#xff0c;NULL &#061; NULL\u7ed3\u679c\u4e3a NULL<\/td>\n<\/tr>\n<tr>\n<td>&lt;&#061;&gt;<\/td>\n<td>\u7b49\u4e8e<\/td>\n<td>NULL \u5b89\u5168&#xff0c;NULL &lt;&#061;&gt; NULL\u7ed3\u679c\u4e3a TRUE<\/td>\n<\/tr>\n<tr>\n<td>!&#061;, &lt;&gt;<\/td>\n<td>\u4e0d\u7b49\u4e8e<\/td>\n<td>NULL \u4e0d\u5b89\u5168<\/td>\n<\/tr>\n<tr>\n<td>BETWEEN a AND b<\/td>\n<td>\u8303\u56f4\u5339\u914d<\/td>\n<td>\u95ed\u533a\u95f4[a, b]<\/td>\n<\/tr>\n<tr>\n<td>IN (v1, v2, &#8230;)<\/td>\n<td>\u96c6\u5408\u5339\u914d<\/td>\n<td>\u4efb\u610f\u4e00\u4e2a\u5339\u914d\u5373\u8fd4\u56de\u771f<\/td>\n<\/tr>\n<tr>\n<td>IS NULL<\/td>\n<td>\u5224\u65ad\u4e3a NULL<\/td>\n<td>\u4e13\u95e8\u7528\u4e8e NULL \u503c\u5224\u65ad<\/td>\n<\/tr>\n<tr>\n<td>IS NOT NULL<\/td>\n<td>\u5224\u65ad\u4e0d\u4e3a NULL<\/td>\n<td>\u4e13\u95e8\u7528\u4e8e NULL \u503c\u5224\u65ad<\/td>\n<\/tr>\n<tr>\n<td>LIKE<\/td>\n<td>\u6a21\u7cca\u5339\u914d<\/td>\n<td>%\u5339\u914d\u4efb\u610f\u591a\u4e2a\u5b57\u7b26&#xff0c;_\u5339\u914d\u4efb\u610f 1 \u4e2a\u5b57\u7b26<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3.2 \u903b\u8f91\u8fd0\u7b97\u7b26<\/h3>\n<table>\n<tr>\u8fd0\u7b97\u7b26\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>AND<\/td>\n<td>\u903b\u8f91\u4e0e&#xff0c;\u6240\u6709\u6761\u4ef6\u540c\u65f6\u6ee1\u8db3\u624d\u4e3a\u771f<\/td>\n<\/tr>\n<tr>\n<td>OR<\/td>\n<td>\u903b\u8f91\u6216&#xff0c;\u4efb\u610f\u4e00\u4e2a\u6761\u4ef6\u6ee1\u8db3\u5373\u4e3a\u771f<\/td>\n<\/tr>\n<tr>\n<td>NOT<\/td>\n<td>\u903b\u8f91\u975e&#xff0c;\u5bf9\u6761\u4ef6\u7ed3\u679c\u53d6\u53cd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3.3 \u6838\u5fc3\u89c4\u5219&#xff1a;WHERE \u4e0d\u53ef\u4f7f\u7528 SELECT \u522b\u540d<\/h3>\n<h4>\u539f\u7406<\/h4>\n<p>SQL \u5355\u8868\u6267\u884c\u987a\u5e8f\u4e2d&#xff0c;WHERE \u6267\u884c\u9636\u6bb5\u65e9\u4e8e SELECT&#xff0c;\u6267\u884c WHERE \u65f6\u5217\u7684\u522b\u540d\u5c1a\u672a\u751f\u6210&#xff0c;\u56e0\u6b64\u65e0\u6cd5\u8bc6\u522b\u522b\u540d\u3002<\/p>\n<h4>\u9519\u8bef\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u62a5\u9519&#xff1a;Unknown column &#039;total&#039; in &#039;where clause&#039;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> chinese <span class=\"token operator\">&#043;<\/span> math <span class=\"token operator\">&#043;<\/span> english total<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<br \/>\n<span class=\"token keyword\">WHERE<\/span> total <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>\u6b63\u786e\u5199\u6cd5<\/h4>\n<p><span class=\"token comment\">&#8212; WHERE\u4e2d\u76f4\u63a5\u4e66\u5199\u5b8c\u6574\u8868\u8fbe\u5f0f<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> chinese <span class=\"token operator\">&#043;<\/span> math <span class=\"token operator\">&#043;<\/span> english \u603b\u5206<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<br \/>\n<span class=\"token keyword\">WHERE<\/span> chinese <span class=\"token operator\">&#043;<\/span> math <span class=\"token operator\">&#043;<\/span> english <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>3.4 \u7b5b\u9009\u6848\u4f8b<\/h3>\n<p><span class=\"token comment\">&#8212; \u82f1\u8bed\u6210\u7ee9\u4f4e\u4e8e60\u5206\u7684\u540c\u5b66<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> english <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">WHERE<\/span> english <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u8bed\u6587\u6210\u7ee9\u5728[80,90]\u5206&#xff08;BETWEEN\u95ed\u533a\u95f4\u5199\u6cd5&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> chinese <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">WHERE<\/span> chinese <span class=\"token operator\">BETWEEN<\/span> <span class=\"token number\">80<\/span> <span class=\"token operator\">AND<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u6570\u5b66\u6210\u7ee9\u662f58\/59\/98\/99&#xff08;IN\u96c6\u5408\u5199\u6cd5&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> math <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">WHERE<\/span> math <span class=\"token operator\">IN<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">58<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">59<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">98<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">99<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u59d3\u5b59\u7684\u540c\u5b66&#xff08;%\u6a21\u7cca\u5339\u914d&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">WHERE<\/span> name <span class=\"token operator\">LIKE<\/span> <span class=\"token string\">&#039;\u5b59%&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u540d\u5b57\u4e3a\u4e24\u4e2a\u5b57\u4e14\u59d3\u5b59&#xff08;_\u5355\u5b57\u7b26\u5339\u914d&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">WHERE<\/span> name <span class=\"token operator\">LIKE<\/span> <span class=\"token string\">&#039;\u5b59_&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u8bed\u6587\u6210\u7ee9 &gt; 80 \u4e14\u4e0d\u59d3\u5b59<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> chinese <span class=\"token keyword\">FROM<\/span> exam_result<br \/>\n<span class=\"token keyword\">WHERE<\/span> chinese <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">80<\/span> <span class=\"token operator\">AND<\/span> name <span class=\"token operator\">NOT<\/span> <span class=\"token operator\">LIKE<\/span> <span class=\"token string\">&#039;\u5b59%&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u67e5\u8be2name\u4e3aNULL\u7684\u8bb0\u5f55<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">FROM<\/span> test <span class=\"token keyword\">WHERE<\/span> name <span class=\"token operator\">IS<\/span> <span class=\"token boolean\">NULL<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h2>4 ~&gt; ORDER BY \u7ed3\u679c\u6392\u5e8f<\/h2>\n<h3>4.1 \u6392\u5e8f\u57fa\u7840<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>\u5bf9\u67e5\u8be2\u7ed3\u679c\u6309\u6307\u5b9a\u5b57\u6bb5\u6392\u5e8f&#xff0c;ASC\u4e3a\u5347\u5e8f&#xff08;\u9ed8\u8ba4\u503c&#xff0c;\u53ef\u7701\u7565&#xff09;&#xff0c;DESC\u4e3a\u964d\u5e8f\u3002<\/p>\n<ul>\n<li>NULL \u503c\u6392\u5e8f\u89c4\u5219&#xff1a;MySQL \u4e2d NULL \u89c6\u4e3a\u5c0f\u4e8e\u6240\u6709\u975e NULL \u503c&#xff0c;\u5347\u5e8f\u65f6\u6392\u5728\u6700\u524d&#xff0c;\u964d\u5e8f\u65f6\u6392\u5728\u6700\u540e\u3002<\/li>\n<\/ul>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u6570\u5b66\u6210\u7ee9\u5347\u5e8f&#xff08;\u9ed8\u8ba4ASC&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> math <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> math <span class=\"token keyword\">ASC<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; \u6570\u5b66\u6210\u7ee9\u964d\u5e8f<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> math <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> math <span class=\"token keyword\">DESC<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>4.2 \u591a\u5b57\u6bb5\u6392\u5e8f<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>\u6309\u591a\u4e2a\u5b57\u6bb5\u6392\u5e8f&#xff0c;\u4f18\u5148\u7ea7\u4ece\u5de6\u5230\u53f3&#xff1a;\u5148\u6309\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u6392\u5e8f&#xff0c;\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u503c\u76f8\u540c\u65f6&#xff0c;\u518d\u6309\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u6392\u5e8f&#xff0c;\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u5148\u6309\u6570\u5b66\u964d\u5e8f&#xff0c;\u6570\u5b66\u540c\u5206\u5219\u6309\u82f1\u8bed\u5347\u5e8f&#xff0c;\u518d\u540c\u5206\u6309\u8bed\u6587\u5347\u5e8f<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> math<span class=\"token punctuation\">,<\/span> english<span class=\"token punctuation\">,<\/span> chinese<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<br \/>\n<span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> math <span class=\"token keyword\">DESC<\/span><span class=\"token punctuation\">,<\/span> english <span class=\"token keyword\">ASC<\/span><span class=\"token punctuation\">,<\/span> chinese <span class=\"token keyword\">ASC<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>4.3 \u6392\u5e8f\u4e0e\u522b\u540d<\/h3>\n<h4>\u539f\u7406<\/h4>\n<p>ORDER BY \u6267\u884c\u9636\u6bb5\u5728 SELECT \u4e4b\u540e&#xff0c;\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528 SELECT \u4e2d\u5b9a\u4e49\u7684\u5217\u522b\u540d\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u4f7f\u7528\u603b\u5206\u522b\u540d\u8fdb\u884c\u964d\u5e8f\u6392\u5e8f<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> name<span class=\"token punctuation\">,<\/span> chinese <span class=\"token operator\">&#043;<\/span> math <span class=\"token operator\">&#043;<\/span> english total<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<br \/>\n<span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> total <span class=\"token keyword\">DESC<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h2>5 ~&gt; LIMIT \u5206\u9875\u7b5b\u9009<\/h2>\n<h3>5.1 \u4e09\u79cd\u8bed\u6cd5\u5f62\u5f0f<\/h3>\n<h4>\u6982\u5ff5<\/h4>\n<p>LIMIT \u7528\u4e8e\u622a\u53d6\u67e5\u8be2\u7ed3\u679c\u7684\u524d N \u6761&#xff0c;\u6216\u4ece\u6307\u5b9a\u4f4d\u7f6e\u5f00\u59cb\u622a\u53d6 N \u6761&#xff0c;\u662f\u5b9e\u73b0\u5206\u9875\u7684\u6838\u5fc3\u8bed\u6cd5\u3002<\/p>\n<p>\u6ce8\u610f&#xff1a;MySQL \u4e2d\u884c\u4e0b\u6807\u4ece 0 \u5f00\u59cb\u3002<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; 1. \u53d6\u524d3\u6761\u7ed3\u679c<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; 2. \u4ece\u4e0b\u68071\u5f00\u59cb&#xff0c;\u53d63\u6761&#xff08;\u5bf9\u5e94\u7b2c2~4\u884c\u6570\u636e&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">&#8212; 3. \u6807\u51c6\u5199\u6cd5&#xff1a;\u53d63\u6761&#xff0c;\u504f\u79fb\u91cf\u4e3a1&#xff08;\u8bed\u4e49\u66f4\u6e05\u6670&#xff0c;\u63a8\u8350\u4f7f\u7528&#xff09;<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">FROM<\/span> exam_result <span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">3<\/span> <span class=\"token keyword\">OFFSET<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>5.2 \u5206\u9875\u4e1a\u52a1\u5b9e\u73b0<\/h3>\n<h4>\u901a\u7528\u516c\u5f0f<\/h4>\n<p>\u7b2cn\u9875&#xff08;\u9875\u7801\u4ece 1 \u5f00\u59cb&#xff09;&#xff0c;\u6bcf\u9875\u5c55\u793asize\u6761&#xff1a; LIMIT size OFFSET (n &#8211; 1) * size<\/p>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p><span class=\"token comment\">&#8212; \u6bcf\u98753\u6761&#xff0c;\u67e5\u8be2\u7b2c2\u9875\u6570\u636e<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> id<span class=\"token punctuation\">,<\/span> name<span class=\"token punctuation\">,<\/span> math<span class=\"token punctuation\">,<\/span> english<span class=\"token punctuation\">,<\/span> chinese<br \/>\n<span class=\"token keyword\">FROM<\/span> exam_result<br \/>\n<span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> id<br \/>\n<span class=\"token keyword\">LIMIT<\/span> <span class=\"token number\">3<\/span> <span class=\"token keyword\">OFFSET<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h2>6 ~&gt; \u6838\u5fc3\u539f\u7406&#xff1a;\u5355\u8868 SQL \u6267\u884c\u987a\u5e8f<\/h2>\n<h3>\u903b\u8f91\u6267\u884c\u987a\u5e8f&#xff08;\u4ece\u5148\u5230\u540e&#xff09;<\/h3>\n<li>FROM&#xff1a;\u786e\u5b9a\u6570\u636e\u6765\u6e90\u8868<\/li>\n<li>WHERE&#xff1a;\u6309\u6761\u4ef6\u7b5b\u9009\u7b26\u5408\u8981\u6c42\u7684\u884c<\/li>\n<li>SELECT&#xff1a;\u786e\u5b9a\u8fd4\u56de\u7684\u5217\u3001\u8ba1\u7b97\u8868\u8fbe\u5f0f\u3001\u751f\u6210\u5217\u522b\u540d<\/li>\n<li>ORDER BY&#xff1a;\u5bf9\u7ed3\u679c\u96c6\u8fdb\u884c\u6392\u5e8f<\/li>\n<li>LIMIT&#xff1a;\u622a\u53d6\u6700\u7ec8\u8fd4\u56de\u7684\u7ed3\u679c\u884c\u6570<\/li>\n<p>\u8be5\u987a\u5e8f\u662f\u7406\u89e3 \u201c\u522b\u540d\u80fd\u5426\u4f7f\u7528\u201d \u7684\u6838\u5fc3\u4f9d\u636e&#xff1a;WHERE \u5728 SELECT \u524d&#xff0c;\u4e0d\u80fd\u7528\u522b\u540d&#xff1b;ORDER BY\u3001LIMIT \u5728 SELECT \u540e&#xff0c;\u53ef\u4ee5\u7528\u522b\u540d\u3002<\/p>\n<hr \/>\n<hr \/>\n<h2>\u7ed3\u5c3e<\/h2>\n<p><font color=\"#3498db\"> uu\u4eec&#xff0c;\u672c\u6587\u7684\u5185\u5bb9\u5230\u8fd9\u91cc\u5c31\u5168\u90e8\u7ed3\u675f\u4e86&#xff0c;\u827e\u8389\u4e1d\u5728\u8fd9\u91cc\u518d\u6b21\u611f\u8c22\u60a8\u7684\u9605\u8bfb&#xff01;<\/font><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<h3>\n<p>      <font color=\"#CC0000\">\u827e\u8389\u4e1d\u52aa\u529b\u7ec3\u5251<\/font><br \/>\n     <\/h3>\n<p><b><\/b><\/p>\n<p>     <font color=\"7B68EE\" size=\"4\">C\/C&#043;&#043; &amp; Linux \u5e95\u5c42\u63a2\u7d22\u8005 | \u4e00\u4e2a\u6b63\u5728\u52aa\u529b\u7ec3\u5251\u7684\u6280\u672f\u535a\u4e3b<\/font><\/p>\n<hr \/>\n<p>      &#x1f440;<br \/>\n      <b>\u3010\u5173\u6ce8\u3011<\/b> \u8ddf\u968f\u6211\u4e00\u8d77\u6df1\u8015\u6280\u672f\u9886\u57df&#xff0c;\u89c1\u8bc1\u6bcf\u4e00\u6b21\u6210\u957f\u3002<\/p>\n<p>      \u2764\ufe0f<br \/>\n      <b>\u3010\u70b9\u8d5e\u3011<\/b> \u8ba9\u4f18\u8d28\u5185\u5bb9\u88ab\u66f4\u591a\u4eba\u770b\u89c1&#xff0c;\u8ba9\u77e5\u8bc6\u4f20\u9012\u66f4\u6709\u529b\u91cf\u3002<\/p>\n<p>      \u2b50<br \/>\n      <b>\u3010\u6536\u85cf\u3011<\/b> \u628a\u6838\u5fc3\u77e5\u8bc6\u70b9\u5b58\u597d&#xff0c;\u5728\u9700\u8981\u65f6\u968f\u65f6\u67e5\u3001\u968f\u65f6\u7528\u3002<\/p>\n<p>      &#x1f4ac;<br \/>\n      <b>\u3010\u8bc4\u8bba\u3011<\/b> \u5206\u4eab\u4f60\u7684\u7ecf\u9a8c\u6216\u7591\u95ee&#xff0c;\u8bc4\u8bba\u533a\u4e00\u8d77\u4ea4\u6d41\u907f\u5751&#xff01;<\/p>\n<p><b><font color=\"#3498db\">\u4e0d\u8981\u5fd8\u8bb0\u7ed9\u535a\u4e3b\u201c\u4e00\u952e\u56db\u8fde\u201d\u54e6&#xff01;<\/font><\/b><\/p>\n<p>       <font color=\"#CC0000\">\u201c\u4eca\u65e5\u7ec3\u5251\u8fbe\u6210&#xff01;\u201d<\/font><\/p>\n<p>     <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183809-6a6502910577b.png\" width=\"200\" \/> <\/p>\n<p> <font color=\"#9b59b6\"> \u201c\u6280\u672f\u4e4b\u8def\u96be\u514d\u6709\u56f0\u60d1&#xff0c;\u4f46\u540c\u884c\u7684\u4eba\u4f1a\u8ba9\u524d\u8fdb\u66f4\u6709\u65b9\u5411\u3002\u201d <\/font><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><font color=\"#e74c3c\"> \u7ed3\u8bed&#xff1a;\u5e0c\u671b\u5bf9\u5b66\u4e60Linux\u76f8\u5173\u5185\u5bb9\u7684uu\u6709\u6240\u5e2e\u52a9&#xff0c;\u4e0d\u8981\u5fd8\u8bb0\u7ed9\u535a\u4e3b\u201c\u4e00\u952e\u56db\u8fde\u201d\u54e6&#xff01;<\/font><\/p>\n<p><font color=\"#9b59b6\">\u5f80\u671f\u56de\u987e&#xff1a;<\/font><\/p>\n<p>\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9&#xff1a;\u8868\u7684\u7ea6\u675f<\/p>\n<p>  <font color=\"#CC0000\">&#x1f5e1;\u535a\u4e3b\u5728\u8fd9\u91cc\u653e\u4e86\u4e00\u53ea\u5c0f\u72d7&#xff0c;\u5927\u5bb6\u770b\u5b8c\u4e86\u6478\u6478\u5c0f\u72d7\u653e\u677e\u4e00\u4e0b\u5427&#xff01;&#x1f5e1; <\/font><\/p>\n<p>  <font color=\"#CC0000\">\u0aee\u208d \u02f6 \u02ca \u1d25 \u02cb\u02f6\u208e\u10d0 <\/font><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183809-6a65029182a7a.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f3ac; \u4e2a\u4eba\u4e3b\u9875&#xff1a;\u827e\u8389\u4e1d\u52aa\u529b\u7ec3\u5251\u2744\u4e13\u680f\u4f20\u9001\u95e8&#xff1a;\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u300b\u300aC\/C\u5e72\u8d27\u5206\u4eab&amp;\u5b66\u4e60\u8fc7\u7a0b\u8bb0\u5f55\u300b \u300aLinux\u64cd\u4f5c\u7cfb\u7edf\u7f16\u7a0b\u8be6\u89e3\u300b\u300a\u7b14\u8bd5\/\u9762\u8bd5\u5e38\u89c1\u7b97\u6cd5&#xff1a;\u4ece\u57fa\u7840\u5230\u8fdb\u9636\u300b\u300aPython\u5e72\u8d27\u5206\u4eab\u300b\u2b50\ufe0f\u4e3a\u5929\u5730\u7acb\u5fc3&#xff0c;\u4e3a\u751f\u6c11\u7acb\u547d&#xff0c;\u4e3a\u5f80\u5723\u7ee7\u7edd\u5b66&#xff0c;\u4e3a\u4e07\u4e16\u5f00\u592a\u5e73 &#x1f3ac; \u827e\u8389\u4e1d\u7684\u7b80\u4ecb&#xff1a; \u6587\u7ae0\u76ee\u5f551 ~&gt; \u6570\u636e\u63d2\u5165&#xff08;Create&#xff09;1.1 \u57fa<\/p>\n","protected":false},"author":2,"featured_media":83619,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9099,84,114,371,100,43],"topic":[],"class_list":["post-83624","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-9099","tag-android","tag-mysql","tag-371","tag-100","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09 - \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\/83624.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f3ac; \u4e2a\u4eba\u4e3b\u9875&#xff1a;\u827e\u8389\u4e1d\u52aa\u529b\u7ec3\u5251\u2744\u4e13\u680f\u4f20\u9001\u95e8&#xff1a;\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u300b\u300aC\/C\u5e72\u8d27\u5206\u4eab&amp;\u5b66\u4e60\u8fc7\u7a0b\u8bb0\u5f55\u300b \u300aLinux\u64cd\u4f5c\u7cfb\u7edf\u7f16\u7a0b\u8be6\u89e3\u300b\u300a\u7b14\u8bd5\/\u9762\u8bd5\u5e38\u89c1\u7b97\u6cd5&#xff1a;\u4ece\u57fa\u7840\u5230\u8fdb\u9636\u300b\u300aPython\u5e72\u8d27\u5206\u4eab\u300b\u2b50\ufe0f\u4e3a\u5929\u5730\u7acb\u5fc3&#xff0c;\u4e3a\u751f\u6c11\u7acb\u547d&#xff0c;\u4e3a\u5f80\u5723\u7ee7\u7edd\u5b66&#xff0c;\u4e3a\u4e07\u4e16\u5f00\u592a\u5e73 &#x1f3ac; \u827e\u8389\u4e1d\u7684\u7b80\u4ecb&#xff1a; \u6587\u7ae0\u76ee\u5f551 ~&gt; \u6570\u636e\u63d2\u5165&#xff08;Create&#xff09;1.1 \u57fa\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/83624.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T18:38:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183808-6a65029078236.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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83624.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/83624.html\",\"name\":\"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T18:38:10+00:00\",\"dateModified\":\"2026-07-25T18:38:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/83624.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/83624.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83624.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09\"}]},{\"@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":"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09 - \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\/83624.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f3ac; \u4e2a\u4eba\u4e3b\u9875&#xff1a;\u827e\u8389\u4e1d\u52aa\u529b\u7ec3\u5251\u2744\u4e13\u680f\u4f20\u9001\u95e8&#xff1a;\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u300b\u300aC\/C\u5e72\u8d27\u5206\u4eab&amp;\u5b66\u4e60\u8fc7\u7a0b\u8bb0\u5f55\u300b \u300aLinux\u64cd\u4f5c\u7cfb\u7edf\u7f16\u7a0b\u8be6\u89e3\u300b\u300a\u7b14\u8bd5\/\u9762\u8bd5\u5e38\u89c1\u7b97\u6cd5&#xff1a;\u4ece\u57fa\u7840\u5230\u8fdb\u9636\u300b\u300aPython\u5e72\u8d27\u5206\u4eab\u300b\u2b50\ufe0f\u4e3a\u5929\u5730\u7acb\u5fc3&#xff0c;\u4e3a\u751f\u6c11\u7acb\u547d&#xff0c;\u4e3a\u5f80\u5723\u7ee7\u7edd\u5b66&#xff0c;\u4e3a\u4e07\u4e16\u5f00\u592a\u5e73 &#x1f3ac; \u827e\u8389\u4e1d\u7684\u7b80\u4ecb&#xff1a; \u6587\u7ae0\u76ee\u5f551 ~&gt; \u6570\u636e\u63d2\u5165&#xff08;Create&#xff09;1.1 \u57fa","og_url":"https:\/\/www.wsisp.com\/helps\/83624.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T18:38:10+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725183808-6a65029078236.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/83624.html","url":"https:\/\/www.wsisp.com\/helps\/83624.html","name":"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T18:38:10+00:00","dateModified":"2026-07-25T18:38:10+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/83624.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/83624.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/83624.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010MYSQL\u3011MYSQL\u5b66\u4e60\u7684\u4e00\u5927\u91cd\u70b9\uff1a\u57fa\u672c\u67e5\u8be2\uff08\u4e0a\uff09"}]},{"@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\/83624","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=83624"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83624\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/83619"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=83624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=83624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=83624"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=83624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}