{"id":2600,"date":"2023-10-15T12:16:39","date_gmt":"2023-10-15T04:16:39","guid":{"rendered":"https:\/\/white-night.club\/?p=2600"},"modified":"2023-11-09T11:07:49","modified_gmt":"2023-11-09T03:07:49","slug":"ad55","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/15\/ad55\/","title":{"rendered":"1517.\u00a0\u67e5\u627e\u62e5\u6709\u6709\u6548\u90ae\u7bb1\u7684\u7528\u6237"},"content":{"rendered":"\n<p>\u8868:\u00a0<code>Users<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| user_id       | int     |\n| name          | varchar |\n| mail          | varchar |\n+---------------+---------+\nuser_id \u662f\u8be5\u8868\u7684\u4e3b\u952e\uff08\u5177\u6709\u552f\u4e00\u503c\u7684\u5217\uff09\u3002\n\u8be5\u8868\u5305\u542b\u4e86\u7f51\u7ad9\u5df2\u6ce8\u518c\u7528\u6237\u7684\u4fe1\u606f\u3002\u6709\u4e00\u4e9b\u7535\u5b50\u90ae\u4ef6\u662f\u65e0\u6548\u7684\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848\uff0c\u4ee5\u67e5\u627e\u5177\u6709\u6709\u6548\u7535\u5b50\u90ae\u4ef6\u7684\u7528\u6237\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2a\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5177\u6709\u524d\u7f00\u540d\u79f0\u548c\u57df\uff0c\u5176\u4e2d\uff1a<\/p>\n\n\n\n<ol>\n<li>&nbsp;<strong>\u524d\u7f00<\/strong>&nbsp;\u540d\u79f0\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u5305\u542b\u5b57\u6bcd\uff08\u5927\u5199\u6216\u5c0f\u5199\uff09\uff0c\u6570\u5b57\uff0c\u4e0b\u5212\u7ebf&nbsp;<code>'_'<\/code>&nbsp;\uff0c\u70b9&nbsp;<code>'.'<\/code>&nbsp;\u548c\/\u6216\u7834\u6298\u53f7&nbsp;<code>'-'<\/code>&nbsp;\u3002\u524d\u7f00\u540d\u79f0&nbsp;<strong>\u5fc5\u987b<\/strong>&nbsp;\u4ee5\u5b57\u6bcd\u5f00\u5934\u3002<\/li>\n\n\n\n<li><strong>\u57df<\/strong>&nbsp;\u4e3a&nbsp;<code>'@leetcode.com'<\/code>&nbsp;\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4efb\u4f55\u987a\u5e8f\u8fd4\u56de\u7ed3\u679c\u8868\u3002<\/p>\n\n\n\n<p>\u7ed3\u679c\u7684\u683c\u5f0f\u5982\u4ee5\u4e0b\u793a\u4f8b\u6240\u793a\uff1a<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>\nUsers \u8868:\n+---------+-----------+-------------------------+\n| user_id | name      | mail                    |\n+---------+-----------+-------------------------+\n| 1       | Winston   | winston@leetcode.com    |\n| 2       | Jonathan  | jonathanisgreat         |\n| 3       | Annabelle | bella-@leetcode.com     |\n| 4       | Sally     | sally.come@leetcode.com |\n| 5       | Marwan    | quarz#2020@leetcode.com |\n| 6       | David     | david69@gmail.com       |\n| 7       | Shapiro   | .shapo@leetcode.com     |\n+---------+-----------+-------------------------+\n<strong>\u8f93\u51fa\uff1a<\/strong>\n+---------+-----------+-------------------------+\n| user_id | name      | mail                    |\n+---------+-----------+-------------------------+\n| 1       | Winston   | winston@leetcode.com    |\n| 3       | Annabelle | bella-@leetcode.com     |\n| 4       | Sally     | sally.come@leetcode.com |\n+---------+-----------+-------------------------+\n<strong>\u89e3\u91ca\uff1a<\/strong>\n\u7528\u6237 2 \u7684\u7535\u5b50\u90ae\u4ef6\u6ca1\u6709\u57df\u3002 \n\u7528\u6237 5 \u7684\u7535\u5b50\u90ae\u4ef6\u5e26\u6709\u4e0d\u5141\u8bb8\u7684 '#' \u7b26\u53f7\u3002\n\u7528\u6237 6 \u7684\u7535\u5b50\u90ae\u4ef6\u6ca1\u6709 leetcode \u57df\u3002 \n\u7528\u6237 7 \u7684\u7535\u5b50\u90ae\u4ef6\u4ee5\u70b9\u5f00\u5934\u3002<\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>\u6b63\u5219\u8868\u8fbe\u5f0f<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u672c\u8eab\u4e0d\u96be\uff0c\u4f46\u662f\u6709\u4e00\u70b9\u9700\u8981\u6ce8\u610f\uff1a<mark style=\"background-color:rgba(0, 0, 0, 0);color:#fcb900\" class=\"has-inline-color\"><strong>MYSQL\u73b0\u5728\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u9ed8\u8ba4\u662f\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u7684<\/strong><\/mark>\u3002MySQL\u9ed8\u8ba4\u7528\u7684\u662futf8_general_ci\u5b57\u7b26\u96c6\u6821\u5bf9\u89c4\u5219\u3002\u8be5\u89c4\u5219\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff0c\u6bd4\u5982&#8217;a&#8217;\u548c&#8217;A&#8217;\u4f1a\u88ab\u89c6\u4e3a\u76f8\u540c\u7684\u5b57\u7b26\u3002\u5982\u679c\u8981\u533a\u5206\u5927\u5c0f\u5199\u7684\u8bdd\u9700\u8981\u7528COLLATE\u6307\u5b9a\u6821\u5bf9\u89c4\u5219\u4e3autf8_bin\u3002<\/p>\n\n\n\n<p>\u672c\u9898\u6ca1\u6709\u5bf9\u5927\u5c0f\u5199\u5b57\u6bcd\u4f5c\u51fa\u7279\u522b\u7684\u8981\u6c42\uff0c\u6240\u4ee5\u76f4\u63a5\u5339\u914d\u5927\u5199\u4e5f\u884c\u3002\u4e0b\u5217SQL\u4e5f\u662f\u53ef\u4ee5\u901a\u8fc7\u6837\u4f8b\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT user_id,name,mail FROM Users\r\nWHERE mail REGEXP '^&#91;A-Z]&#91;A-Z0-9\\_\\.\\-]*\\@leetcode&#91;.]com'\r<\/code><\/pre>\n\n\n\n<p>\u4f46\u662f\u5982\u679c\u6709\u8981\u6c42\uff0c\u6bd4\u5982\u201c\u5f00\u5934\u5b57\u6bcd\u5fc5\u987b\u4e3a\u5927\u5199\u201d\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u7528COLLATE\u6307\u5b9a\u6821\u5bf9\u89c4\u5219\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT user_id,name,mail FROM Users\r\nWHERE mail COLLATE utf8_bin REGEXP '^&#91;A-Z]&#91;A-Za-z0-9\\_\\.\\-]*\\@leetcode&#91;.]com'\r<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2600"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=2600"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2600\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=2600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}