{"id":153667,"date":"2024-11-02T09:21:18","date_gmt":"2024-11-02T01:21:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/153667\/"},"modified":"2024-11-02T09:21:19","modified_gmt":"2024-11-02T01:21:19","slug":"%e5%a4%a7%e5%b0%8f%e5%af%ab%e4%b8%8d%e5%90%8c%ef%bc%8c%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a1%a8%e8%bc%95%e9%87%8d%e4%b8%8d%e5%90%8c%ef%bc%9a%e6%af%94%e8%bc%83%e5%85%a9%e5%80%8b%e8%a1%a8%e7%9a%84%e5%a4%a7","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/153667\/","title":{"rendered":"\u5927\u5c0f\u5beb\u4e0d\u540c\uff0c\u6578\u64da\u5eab\u8868\u8f15\u91cd\u4e0d\u540c\uff1a\u6bd4\u8f03\u5169\u500b\u8868\u7684\u5927\u5c0f\u5beb (\u5169\u500b\u6578\u64da\u5eab\u8868\u6bd4\u8f03\u5927\u5c0f\u5beb)"},"content":{"rendered":"<h1 id=\"%e5%a4%a7%e5%b0%8f%e5%af%ab%e4%b8%8d%e5%90%8c%ef%bc%8c%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a1%a8%e8%bc%95%e9%87%8d%e4%b8%8d%e5%90%8c%ef%bc%9a%e6%af%94%e8%bc%83%e5%85%a9%e5%80%8b%e8%a1%a8%e7%9a%84%e5%a4%a7-AaTrksCVlN\">\u5927\u5c0f\u5beb\u4e0d\u540c\uff0c\u6578\u64da\u5eab\u8868\u8f15\u91cd\u4e0d\u540c\uff1a\u6bd4\u8f03\u5169\u500b\u8868\u7684\u5927\u5c0f\u5beb<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u4e2d\uff0c\u5927\u5c0f\u5beb\u7684\u8655\u7406\u5c0d\u65bc\u6578\u64da\u7684\u5b58\u53d6\u548c\u6bd4\u8f03\u81f3\u95dc\u91cd\u8981\u3002\u4e0d\u540c\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u5c0d\u5927\u5c0f\u5beb\u7684\u654f\u611f\u6027\u6709\u6240\u4e0d\u540c\uff0c\u9019\u53ef\u80fd\u6703\u5f71\u97ff\u5230\u6578\u64da\u7684\u67e5\u8a62\u7d50\u679c\u548c\u6027\u80fd\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u5982\u4f55\u6bd4\u8f03\u5169\u500b\u6578\u64da\u5eab\u8868\u7684\u5927\u5c0f\u5beb\uff0c\u4e26\u5206\u6790\u5176\u5c0d\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u5f71\u97ff\u3002<\/p>\n<h2 id=\"%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%95%8f%e6%84%9f%e6%80%a7%e6%a6%82%e8%bf%b0-AaTrksCVlN\">\u5927\u5c0f\u5beb\u654f\u611f\u6027\u6982\u8ff0<\/h2>\n<p>\u5728\u6578\u64da\u5eab\u4e2d\uff0c\u5927\u5c0f\u5beb\u654f\u611f\u6027\u6307\u7684\u662f\u6578\u64da\u5eab\u7cfb\u7d71\u5728\u6bd4\u8f03\u5b57\u7b26\u4e32\u6642\u662f\u5426\u5340\u5206\u5b57\u6bcd\u7684\u5927\u5c0f\u5beb\u3002\u67d0\u4e9b\u6578\u64da\u5eab\u7cfb\u7d71\uff08\u5982 PostgreSQL\uff09\u9810\u8a2d\u70ba\u5927\u5c0f\u5beb\u654f\u611f\uff0c\u800c\u5176\u4ed6\u7cfb\u7d71\uff08\u5982 MySQL\uff09\u5247\u53ef\u4ee5\u6839\u64da\u5b57\u7b26\u96c6\u548c\u6392\u5e8f\u898f\u5247\u9032\u884c\u914d\u7f6e\u3002<\/p>\n<h3 id=\"%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%95%8f%e6%84%9f%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab-AaTrksCVlN\">\u5927\u5c0f\u5beb\u654f\u611f\u7684\u6578\u64da\u5eab<\/h3>\n<ul>\n<li><strong>PostgreSQL\uff1a<\/strong>\u9810\u8a2d\u60c5\u6cc1\u4e0b\uff0cPostgreSQL \u5c0d\u5b57\u7b26\u4e32\u6bd4\u8f03\u662f\u5927\u5c0f\u5beb\u654f\u611f\u7684\u3002\u4f8b\u5982\uff0c&#8217;abc&#8217; \u548c &#8216;ABC&#8217; \u88ab\u8996\u70ba\u4e0d\u540c\u7684\u5b57\u7b26\u4e32\u3002<\/li>\n<li><strong>Oracle\uff1a<\/strong>Oracle \u6578\u64da\u5eab\u5728\u5b57\u7b26\u4e32\u6bd4\u8f03\u6642\u4e5f\u662f\u5927\u5c0f\u5beb\u654f\u611f\u7684\uff0c\u9019\u610f\u5473\u8457\u5728\u67e5\u8a62\u6642\u9700\u8981\u7279\u5225\u6ce8\u610f\u5927\u5c0f\u5beb\u7684\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h3 id=\"%e5%a4%a7%e5%b0%8f%e5%af%ab%e4%b8%8d%e6%95%8f%e6%84%9f%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab-AaTrksCVlN\">\u5927\u5c0f\u5beb\u4e0d\u654f\u611f\u7684\u6578\u64da\u5eab<\/h3>\n<ul>\n<li><strong>MySQL\uff1a<\/strong>MySQL \u7684\u5927\u5c0f\u5beb\u654f\u611f\u6027\u53d6\u6c7a\u65bc\u5176\u5b57\u7b26\u96c6\u548c\u6392\u5e8f\u898f\u5247\u3002\u9810\u8a2d\u7684\u5b57\u7b26\u96c6\uff08\u5982 utf8_general_ci\uff09\u662f\u5927\u5c0f\u5beb\u4e0d\u654f\u611f\u7684\uff0c\u800c utf8_bin \u5247\u662f\u5927\u5c0f\u5beb\u654f\u611f\u7684\u3002<\/li>\n<li><strong>SQL Server\uff1a<\/strong>SQL Server \u4e5f\u53ef\u4ee5\u6839\u64da\u6392\u5e8f\u898f\u5247\u4f86\u8a2d\u7f6e\u5927\u5c0f\u5beb\u654f\u611f\u6027\uff0c\u4f7f\u7528 collation \u4f86\u63a7\u5236\u5b57\u7b26\u4e32\u7684\u6bd4\u8f03\u884c\u70ba\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%af%94%e8%bc%83%e5%85%a9%e5%80%8b%e8%a1%a8%e7%9a%84%e5%a4%a7%e5%b0%8f%e5%af%ab-AaTrksCVlN\">\u6bd4\u8f03\u5169\u500b\u8868\u7684\u5927\u5c0f\u5beb<\/h2>\n<p>\u5728\u5be6\u969b\u61c9\u7528\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u6bd4\u8f03\u5169\u500b\u8868\u4e2d\u7684\u6578\u64da\uff0c\u4e26\u8003\u616e\u5230\u5927\u5c0f\u5beb\u7684\u5f71\u97ff\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5728 MySQL \u4e2d\u6bd4\u8f03\u5169\u500b\u8868\u7684\u6578\u64da\uff0c\u4e26\u8003\u616e\u5927\u5c0f\u5beb\u7684\u5dee\u7570\u3002<\/p>\n<pre><code>SELECT a.column_name\nFROM table_a a\nJOIN table_b b ON a.column_name = b.column_name COLLATE utf8_bin;\n<\/code><\/pre>\n<p>\u5728\u9019\u500b\u67e5\u8a62\u4e2d\uff0c\u6211\u5011\u4f7f\u7528\u4e86 COLLATE \u5b50\u53e5\u4f86\u5f37\u5236 MySQL \u9032\u884c\u5927\u5c0f\u5beb\u654f\u611f\u7684\u6bd4\u8f03\u3002\u9019\u6a23\u53ef\u4ee5\u78ba\u4fdd\u53ea\u6709\u5728\u5169\u500b\u8868\u4e2d\u5b8c\u5168\u76f8\u540c\u7684\u5b57\u7b26\u4e32\uff08\u5305\u62ec\u5927\u5c0f\u5beb\uff09\u624d\u6703\u88ab\u9078\u4e2d\u3002<\/p>\n<h2 id=\"%e5%a4%a7%e5%b0%8f%e5%af%ab%e8%99%95%e7%90%86%e7%9a%84%e6%9c%80%e4%bd%b3%e5%af%a6%e8%b8%90-AaTrksCVlN\">\u5927\u5c0f\u5beb\u8655\u7406\u7684\u6700\u4f73\u5be6\u8e10<\/h2>\n<p>\u5728\u8a2d\u8a08\u6578\u64da\u5eab\u6642\uff0c\u8003\u616e\u5230\u5927\u5c0f\u5beb\u7684\u8655\u7406\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5be6\u8e10\uff1a<\/p>\n<ul>\n<li><strong>\u7d71\u4e00\u5927\u5c0f\u5beb\uff1a<\/strong>\u5728\u63d2\u5165\u6578\u64da\u6642\uff0c\u7d71\u4e00\u4f7f\u7528\u5c0f\u5beb\u6216\u5927\u5beb\uff0c\u9019\u6a23\u53ef\u4ee5\u6e1b\u5c11\u56e0\u5927\u5c0f\u5beb\u4e0d\u4e00\u81f4\u800c\u5c0e\u81f4\u7684\u67e5\u8a62\u554f\u984c\u3002<\/li>\n<li><strong>\u4f7f\u7528\u5927\u5c0f\u5beb\u654f\u611f\u7684\u6bd4\u8f03\uff1a<\/strong>\u5728\u9700\u8981\u7cbe\u78ba\u5339\u914d\u7684\u60c5\u6cc1\u4e0b\uff0c\u4f7f\u7528\u5927\u5c0f\u5beb\u654f\u611f\u7684\u6bd4\u8f03\u65b9\u6cd5\u3002<\/li>\n<li><strong>\u9078\u64c7\u5408\u9069\u7684\u5b57\u7b26\u96c6\uff1a<\/strong>\u6839\u64da\u61c9\u7528\u9700\u6c42\u9078\u64c7\u5408\u9069\u7684\u5b57\u7b26\u96c6\u548c\u6392\u5e8f\u898f\u5247\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u6b63\u78ba\u6027\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-AaTrksCVlN\">\u7d50\u8ad6<\/h2>\n<p>\u5927\u5c0f\u5beb\u5728\u6578\u64da\u5eab\u64cd\u4f5c\u4e2d\u626e\u6f14\u8457\u91cd\u8981\u89d2\u8272\uff0c\u7279\u5225\u662f\u5728\u6bd4\u8f03\u548c\u67e5\u8a62\u6578\u64da\u6642\u3002\u4e86\u89e3\u4e0d\u540c\u6578\u64da\u5eab\u7cfb\u7d71\u7684\u5927\u5c0f\u5beb\u654f\u611f\u6027\u4ee5\u53ca\u5982\u4f55\u6b63\u78ba\u6bd4\u8f03\u6578\u64da\uff0c\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u907f\u514d\u6f5b\u5728\u7684\u554f\u984c\u3002\u7121\u8ad6\u662f\u9078\u64c7\u5927\u5c0f\u5beb\u654f\u611f\u9084\u662f\u5927\u5c0f\u5beb\u4e0d\u654f\u611f\u7684\u6bd4\u8f03\u65b9\u5f0f\uff0c\u95dc\u9375\u5728\u65bc\u6839\u64da\u5177\u9ad4\u9700\u6c42\u505a\u51fa\u660e\u667a\u7684\u9078\u64c7\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c\u6578\u64da\u5eab\u7ba1\u7406\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6bd4\u8f03\u5169\u500b\u6578\u64da\u5eab\u8868\u7684\u5927\u5c0f\u5beb\u5dee\u7570\uff0c\u63a2\u8a0e\u5176\u5c0d\u6578\u64da\u5eab\u6027\u80fd\u548c\u67e5\u8a62\u7d50\u679c\u7684\u5f71\u97ff\uff0c\u63ed\u793a\u5927\u5c0f\u5beb\u7684\u91cd\u8981\u6027\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-153667","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153667","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=153667"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153667\/revisions"}],"predecessor-version":[{"id":153668,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/153667\/revisions\/153668"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=153667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=153667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=153667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}