{"id":25753,"date":"2024-11-24T12:51:10","date_gmt":"2024-11-24T04:51:10","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25753\/"},"modified":"2024-11-24T12:51:10","modified_gmt":"2024-11-24T04:51:10","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-mysql-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e6%9f%a5%e8%af%a2%e5%8c%85%e5%90%ab%e6%97%a5%e6%96%87%e5%81%87%e5%90%8d%e7%9a%84%e5%ad%97%e6%ae%b5%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25753\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 MySQL \u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u8be2\u5305\u542b\u65e5\u6587\u5047\u540d\u7684\u5b57\u6bb5\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173069571331542.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 MySQL \u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u8be2\u5305\u542b\u65e5\u6587\u5047\u540d\u7684\u5b57\u6bb5\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 MySQL \u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u8be2\u5305\u542b\u65e5\u6587\u5047\u540d\u7684\u5b57\u6bb5\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728  \u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u8be2\u5e26\u6709\u65e5\u6587\u5047\u540d\u7684\u5b57\u6bb5\uff1f<\/strong><\/p>\n<p>\u5728 mysql \u4e2d\uff0c\u60a8\u9047\u5230\u7684\u67e5\u8be2\u4e0d\u51c6\u786e\u7684\u95ee\u9898\u53ef\u80fd\u662f\u7531\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u9650\u5236\u6240\u81f4\u3002\u56fe\u4e2d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f [\u30a1-\u30f3] \u53ea\u5339\u914d\u7247\u5047\u540d\uff0c\u800c [\u3041-\u3093] \u4ec5\u5339\u914d\u5e73\u5047\u540d\u3002\u8fd9\u5bfc\u81f4\u4e86\u5728\u67e5\u8be2\u4e2d\u540c\u65f6\u5305\u542b\u5e73\u5047\u540d\u548c\u7247\u5047\u540d\u7684\u6807\u9898\u65f6\uff0c\u51fa\u73b0\u4e86\u610f\u5916\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u8981\u6709\u6548\u5730\u67e5\u627e\u5e26\u6709\u65e5\u6587\u5047\u540d\u7684\u6807\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u81ea\u5b9a\u4e49\u51fd\u6570\u6765\u68c0\u67e5\u6587\u672c\u4e2d\u662f\u5426\u5b58\u5728\u5047\u540d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5b9e\u73b0\u6b64\u529f\u80fd\u7684 mysql \u51fd\u6570\uff1a<\/p>\n<pre>create definer=`wq19bar`@`%` function `jp_char_inside`(s text) returns int(11)\nbegin\n    declare h text;\n    declare p integer;\n    declare l integer;\n    declare head text;\n    declare utf_8 text;\n    set h = hex(s);\n    set p = 1;\n    set l = length(h);\n    while p &lt;= l do\n        set head = substr(h, p, 1);\n        if head &lt; '8' then\n            set p = p + 2;\n        else\n            set utf_8 = substr(h, p, 6);\n            if (utf_8 &gt;= 'e38181' and utf_8 &lt;= 'e3829e') then\n                return 1;\n            end if;\n            if (utf_8 &gt;= 'e382a1' and utf_8 &lt;= 'e383be') then\n                return 1;\n            end if;\n            set p = p + 6;\n        end if;\n    end while;\nreturn 0;\nend<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f7f\u7528\u6b64\u51fd\u6570\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\u6765\u67e5\u627e\u5e26\u6709\u65e5\u6587\u5047\u540d\u7684\u6807\u9898\uff1a<\/p>\n<pre>SELECT * FROM table_name WHERE jp_char_inside(title) = 1;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 MySQL \u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u8be2\u5305\u542b\u65e5\u6587\u5047\u540d\u7684\u5b57\u6bb5\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728 \u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u8be2\u5e26\u6709\u65e5\u6587\u5047\u540d\u7684\u5b57\u6bb5\uff1f \u5728 mysql \u4e2d\uff0c\u60a8\u9047\u5230\u7684\u67e5\u8be2\u4e0d\u51c6\u786e\u7684\u95ee\u9898\u53ef\u80fd\u662f\u7531\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u9650\u5236\u6240\u81f4\u3002\u56fe\u4e2d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f [\u30a1-\u30f3] \u53ea\u5339\u914d\u7247\u5047\u540d\uff0c\u800c [\u3041-\u3093] \u4ec5\u5339\u914d\u5e73\u5047\u540d\u3002\u8fd9\u5bfc\u81f4\u4e86\u5728\u67e5\u8be2\u4e2d\u540c\u65f6\u5305\u542b\u5e73\u5047\u540d\u548c\u7247\u5047\u540d\u7684\u6807\u9898\u65f6\uff0c\u51fa\u73b0\u4e86\u610f\u5916\u7684\u7ed3\u679c\u3002 \u8981\u6709\u6548\u5730\u67e5\u627e\u5e26\u6709\u65e5\u6587\u5047\u540d\u7684\u6807\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u81ea\u5b9a\u4e49\u51fd\u6570\u6765\u68c0\u67e5\u6587\u672c\u4e2d\u662f\u5426\u5b58\u5728\u5047\u540d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5b9e\u73b0\u6b64\u529f\u80fd\u7684 mysql \u51fd\u6570\uff1a create definer=`wq19bar`@`%` function `jp_char_inside`(s text) returns int(11) begin declare h text; declare p integer; declare l integer; declare head text; declare utf_8 text; set h = hex(s); set p = 1; set l = length(h); while p &lt;= l do set head = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-25753","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=25753"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25753\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}