{"id":153699,"date":"2024-11-02T09:37:19","date_gmt":"2024-11-02T01:37:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/153699\/"},"modified":"2024-11-02T09:37:20","modified_gmt":"2024-11-02T01:37:20","slug":"%e5%b8%b6%e4%bd%a0%e8%ae%80-mysql-%e6%ba%90%e7%a2%bc%ef%bc%9aselect","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/153699\/","title":{"rendered":"\u5e36\u4f60\u8b80 MySQL \u6e90\u78bc\uff1aSelect *"},"content":{"rendered":"<h1 id=\"%e5%b8%b6%e4%bd%a0%e8%ae%80-mysql-%e6%ba%90%e7%a2%bc%ef%bc%9aselect-IwRURsfDVc\">\u5e36\u4f60\u8b80 MySQL \u6e90\u78bc\uff1aSelect *<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u4e2d\uff0cMySQL \u662f\u4e00\u500b\u5ee3\u6cdb\u4f7f\u7528\u7684\u958b\u6e90\u95dc\u806f\u6578\u64da\u5eab\u3002\u5b83\u7684\u9748\u6d3b\u6027\u548c\u9ad8\u6548\u6027\u4f7f\u5176\u6210\u70ba\u8a31\u591a\u61c9\u7528\u7a0b\u5e8f\u7684\u9996\u9078\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e MySQL \u7684\u6e90\u78bc\uff0c\u7279\u5225\u662f <code>SELECT *<\/code> \u8a9e\u53e5\u7684\u5be6\u73fe\uff0c\u5e6b\u52a9\u8b80\u8005\u7406\u89e3\u5176\u80cc\u5f8c\u7684\u904b\u4f5c\u539f\u7406\u3002<\/p>\n<h2 id=\"mysql-%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%9e%b6%e6%a7%8b-IwRURsfDVc\">MySQL \u7684\u57fa\u672c\u67b6\u69cb<\/h2>\n<p>MySQL \u7684\u67b6\u69cb\u53ef\u4ee5\u5206\u70ba\u5e7e\u500b\u4e3b\u8981\u7d44\u4ef6\uff0c\u5305\u62ec\u5ba2\u6236\u7aef\u3001\u670d\u52d9\u5668\u548c\u5b58\u5132\u5f15\u64ce\u3002\u5ba2\u6236\u7aef\u8ca0\u8cac\u767c\u9001\u8acb\u6c42\uff0c\u670d\u52d9\u5668\u8655\u7406\u8acb\u6c42\u4e26\u8fd4\u56de\u7d50\u679c\uff0c\u800c\u5b58\u5132\u5f15\u64ce\u5247\u8ca0\u8cac\u6578\u64da\u7684\u5be6\u969b\u5b58\u5132\u548c\u6aa2\u7d22\u3002\u9019\u7a2e\u5206\u5c64\u67b6\u69cb\u4f7f\u5f97 MySQL \u80fd\u5920\u9748\u6d3b\u5730\u652f\u6301\u4e0d\u540c\u7684\u5b58\u5132\u5f15\u64ce\uff0c\u5982 InnoDB \u548c MyISAM\u3002<\/p>\n<h2 id=\"select-%e8%aa%9e%e5%8f%a5%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-IwRURsfDVc\">SELECT \u8a9e\u53e5\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p><code>SELECT<\/code> \u8a9e\u53e5\u662f SQL \u4e2d\u6700\u5e38\u7528\u7684\u67e5\u8a62\u8a9e\u53e5\u4e4b\u4e00\u3002\u5b83\u7528\u65bc\u5f9e\u6578\u64da\u5eab\u4e2d\u6aa2\u7d22\u6578\u64da\u3002\u7576\u4f7f\u7528 <code>SELECT *<\/code> \u6642\uff0c\u8868\u793a\u9078\u64c7\u6240\u6709\u5217\u7684\u6578\u64da\u3002\u9019\u5728\u958b\u767c\u548c\u6e2c\u8a66\u968e\u6bb5\u975e\u5e38\u65b9\u4fbf\uff0c\u4f46\u5728\u751f\u7522\u74b0\u5883\u4e2d\uff0c\u904e\u591a\u7684\u6578\u64da\u6aa2\u7d22\u53ef\u80fd\u6703\u5f71\u97ff\u6027\u80fd\u3002<\/p>\n<h2 id=\"select-%e7%9a%84%e6%ba%90%e7%a2%bc%e5%88%86%e6%9e%90-IwRURsfDVc\">SELECT * \u7684\u6e90\u78bc\u5206\u6790<\/h2>\n<p>\u5728 MySQL \u7684\u6e90\u78bc\u4e2d\uff0c<code>SELECT *<\/code> \u7684\u8655\u7406\u904e\u7a0b\u76f8\u5c0d\u8907\u96dc\u3002\u7576\u7528\u6236\u767c\u9001\u4e00\u500b <code>SELECT *<\/code> \u8acb\u6c42\u6642\uff0cMySQL \u6703\u7d93\u904e\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<ul>\n<li><strong>\u89e3\u6790\u8acb\u6c42\uff1a<\/strong>MySQL \u9996\u5148\u6703\u89e3\u6790 SQL \u8a9e\u53e5\uff0c\u5c07\u5176\u8f49\u63db\u70ba\u5167\u90e8\u8868\u793a\u5f62\u5f0f\u3002\u9019\u4e00\u904e\u7a0b\u6d89\u53ca\u5230\u8a9e\u6cd5\u5206\u6790\u548c\u8a9e\u7fa9\u5206\u6790\u3002<\/li>\n<li><strong>\u67e5\u627e\u5143\u6578\u64da\uff1a<\/strong>\u63a5\u4e0b\u4f86\uff0cMySQL \u6703\u67e5\u627e\u76f8\u95dc\u8868\u7684\u5143\u6578\u64da\uff0c\u4ee5\u78ba\u5b9a\u9700\u8981\u6aa2\u7d22\u7684\u5217\u3002\u9019\u4e00\u904e\u7a0b\u4e2d\uff0cMySQL \u6703\u8a2a\u554f\u4fe1\u606f\u67b6\u69cb\uff08information_schema\uff09\u4f86\u7372\u53d6\u8868\u7d50\u69cb\u4fe1\u606f\u3002<\/li>\n<li><strong>\u751f\u6210\u67e5\u8a62\u8a08\u5283\uff1a<\/strong>\u5728\u7372\u53d6\u5143\u6578\u64da\u5f8c\uff0cMySQL \u6703\u751f\u6210\u67e5\u8a62\u8a08\u5283\uff0c\u6c7a\u5b9a\u5982\u4f55\u9ad8\u6548\u5730\u6aa2\u7d22\u6578\u64da\u3002\u9019\u53ef\u80fd\u6d89\u53ca\u5230\u4f7f\u7528\u7d22\u5f15\u4f86\u52a0\u901f\u67e5\u8a62\u3002<\/li>\n<li><strong>\u57f7\u884c\u67e5\u8a62\uff1a<\/strong>\u6700\u5f8c\uff0cMySQL \u6703\u57f7\u884c\u67e5\u8a62\u8a08\u5283\uff0c\u5f9e\u5b58\u5132\u5f15\u64ce\u4e2d\u6aa2\u7d22\u6578\u64da\u4e26\u8fd4\u56de\u7d50\u679c\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ba%90%e7%a2%bc%e7%a4%ba%e4%be%8b-IwRURsfDVc\">\u6e90\u78bc\u793a\u4f8b<\/h3>\n<p>\u4ee5\u4e0b\u662f MySQL \u4e2d\u8655\u7406 <code>SELECT *<\/code> \u7684\u4e00\u500b\u7c21\u5316\u793a\u4f8b\uff1a<\/p>\n<pre><code>SELECT * FROM table_name WHERE condition;\n<\/code><\/pre>\n<p>\u5728\u9019\u6bb5\u4ee3\u78bc\u4e2d\uff0cMySQL \u6703\u9996\u5148\u89e3\u6790 <code>table_name<\/code> \u7684\u7d50\u69cb\uff0c\u7136\u5f8c\u6839\u64da <code>condition<\/code> \u689d\u4ef6\u6aa2\u7d22\u6240\u6709\u5217\u7684\u6578\u64da\u3002\u9019\u4e00\u904e\u7a0b\u6d89\u53ca\u5230\u591a\u500b\u5167\u90e8\u51fd\u6578\u7684\u8abf\u7528\uff0c\u5982 <code>mysql_parse<\/code> \u548c <code>mysql_execute<\/code>\u3002<\/p>\n<h2 id=\"%e6%80%a7%e8%83%bd%e8%80%83%e9%87%8f-IwRURsfDVc\">\u6027\u80fd\u8003\u91cf<\/h2>\n<p>\u96d6\u7136 <code>SELECT *<\/code> \u5728\u958b\u767c\u904e\u7a0b\u4e2d\u975e\u5e38\u65b9\u4fbf\uff0c\u4f46\u5728\u751f\u7522\u74b0\u5883\u4e2d\u61c9\u8b39\u614e\u4f7f\u7528\u3002\u56e0\u70ba\u5b83\u6703\u6aa2\u7d22\u6240\u6709\u5217\u7684\u6578\u64da\uff0c\u9019\u53ef\u80fd\u5c0e\u81f4\u4e0d\u5fc5\u8981\u7684\u6027\u80fd\u640d\u8017\u3002\u5efa\u8b70\u958b\u767c\u8005\u5728\u5be6\u969b\u61c9\u7528\u4e2d\uff0c\u6839\u64da\u9700\u8981\u660e\u78ba\u6307\u5b9a\u6240\u9700\u7684\u5217\uff0c\u4ee5\u63d0\u9ad8\u67e5\u8a62\u6548\u7387\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-IwRURsfDVc\">\u7d50\u8ad6<\/h2>\n<p>\u901a\u904e\u5c0d MySQL \u6e90\u78bc\u4e2d <code>SELECT *<\/code> \u7684\u5206\u6790\uff0c\u6211\u5011\u53ef\u4ee5\u770b\u5230\u5176\u80cc\u5f8c\u7684\u904b\u4f5c\u908f\u8f2f\u548c\u6027\u80fd\u8003\u91cf\u3002\u7406\u89e3\u9019\u4e9b\u7d30\u7bc0\u4e0d\u50c5\u6709\u52a9\u65bc\u958b\u767c\u8005\u512a\u5316\u67e5\u8a62\uff0c\u9084\u80fd\u63d0\u9ad8\u6574\u9ad4\u61c9\u7528\u7684\u6027\u80fd\u3002\u5728\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u6642\uff0c\u8003\u616e\u5230\u6027\u80fd\u548c\u9748\u6d3b\u6027\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u6216\u5176\u4ed6 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a> \u89e3\u6c7a\u65b9\u6848\u6709\u8208\u8da3\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6df1\u5165\u89e3\u6790 MySQL \u6e90\u78bc\uff0c\u63a2\u7d22 Select * \u7684\u904b\u4f5c\u539f\u7406\uff0c\u63ed\u793a\u6578\u64da\u5eab\u80cc\u5f8c\u7684\u79d8\u5bc6\u8207\u6700\u4f73\u5be6\u8e10\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-153699","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=153699"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153699\/revisions"}],"predecessor-version":[{"id":153700,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153699\/revisions\/153700"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=153699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=153699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=153699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}