<\/path> \n<\/svg> <\/p>\n1\u3001left\uff08name,4\uff09\u622a\u53d6\u5de6\u8fb9\u76844\u4e2a\u5b57\u7b26
\u5217\uff1a<\/p>\n
SELECT LEFT(201809,4) \u5e74<\/p>\n
\u7ed3\u679c\uff1a2018<\/p>\n
2\u3001right\uff08name,2\uff09\u622a\u53d6\u53f3\u8fb9\u76842\u4e2a\u5b57\u7b26
SELECT RIGHT(201809,2) \u6708\u4efd<\/p>\n
\u7ed3\u679c\uff1a09<\/p>\n
3\u3001SUBSTRING(name,5,3) \u622a\u53d6name\u8fd9\u4e2a\u5b57\u6bb5 \u4ece\u7b2c\u4e94\u4e2a\u5b57\u7b26\u5f00\u59cb \u53ea\u622a\u53d6\u4e4b\u540e\u76843\u4e2a\u5b57\u7b26
SELECT SUBSTRING(\u201c\u6210\u90fd\u878d\u8d44\u4e8b\u4e1a\u90e8\u201d,5,3)<\/p>\n
\u7ed3\u679c\uff1a\u4e8b\u4e1a\u90e8<\/p>\n
4\u3001SUBSTRING(name,3) \u622a\u53d6name\u8fd9\u4e2a\u5b57\u6bb5 \u4ece\u7b2c\u4e09\u4e2a\u5b57\u7b26\u5f00\u59cb\uff0c\u4e4b\u540e\u7684\u6240\u6709\u4e2a\u5b57\u7b26
SELECT SUBSTRING(\u201c\u6210\u90fd\u878d\u8d44\u4e8b\u4e1a\u90e8\u201d,3)<\/p>\n
\u7ed3\u679c\uff1a\u878d\u8d44\u4e8b\u4e1a\u90e8<\/p>\n
5\u3001SUBSTRING(name, -4) \u622a\u53d6name\u8fd9\u4e2a\u5b57\u6bb5\u7684\u7b2c 4 \u4e2a\u5b57\u7b26\u4f4d\u7f6e\uff08\u5012\u6570\uff09\u5f00\u59cb\u53d6\uff0c\u76f4\u5230\u7ed3\u675f
SELECT SUBSTRING(\u201c\u6210\u90fd\u878d\u8d44\u4e8b\u4e1a\u90e8\u201d,-3)<\/p>\n
\u7ed3\u679c\uff1a\u4e8b\u4e1a\u90e8<\/p>\n
6\u3001SUBSTRING(name, -4\uff0c2) \u622a\u53d6name\u8fd9\u4e2a\u5b57\u6bb5\u7684\u7b2c 4 \u4e2a\u5b57\u7b26\u4f4d\u7f6e\uff08\u5012\u6570\uff09\u5f00\u59cb\u53d6\uff0c\u53ea\u622a\u53d6\u4e4b\u540e\u76842\u4e2a\u5b57\u7b26
SELECT SUBSTRING(\u201c\u6210\u90fd\u878d\u8d44\u4e8b\u4e1a\u90e8\u201d,-5,2)<\/p>\n
\u7ed3\u679c\uff1a\u878d\u8d44<\/p>\n
\u6ce8\u610f\uff1a\u6211\u4eec\u6ce8\u610f\u5230\u5728\u51fd\u6570 substring(str,pos, len)\u4e2d\uff0c pos \u53ef\u4ee5\u662f\u8d1f\u503c\uff0c\u4f46 len \u4e0d\u80fd\u53d6\u8d1f\u503c\u3002<\/p>\n
7\u3001select substring_index(\u201cwww.baidu.com\u201d, \u2018.\u2019, 2)\u622a\u53d6\u7b2c\u4e8c\u4e2a \u2018.\u2019 \u4e4b\u524d\u7684\u6240\u6709\u5b57\u7b26
select substring_index(\u201cwww.baidu.com\u201d, \u2018.\u2019, 2)<\/p>\n
\u7ed3\u679c\uff1awww.baidu<\/p>\n
8\u3001select substring_index(\u201cwww.baidu.com\u201d, \u2018.\u2019, -2) \u622a\u53d6\u7b2c\u4e8c\u4e2a \u2018.\u2019 \uff08\u5012\u6570\uff09\u4e4b\u540e\u7684\u6240\u6709\u5b57\u7b26
select substring_index(\u201cwww.baidu.com\u201d, \u2018.\u2019, -2)
\u7ed3\u679c\uff1abaidu.com<\/p>\n
9\u3001SUBSTR(name, 1, CHAR_LENGTH(name)-3) \u622a\u53d6name\u5b57\u6bb5\uff0c\u53d6\u9664name\u5b57\u6bb5\u540e\u4e09\u4f4d\u7684\u6240\u6709\u5b57\u7b26
SELECT SUBSTR(\u201c\u6210\u90fd\u878d\u8d44\u4e8b\u4e1a\u90e8\u201d, 1, CHAR_LENGTH(\u201c\u6210\u90fd\u878d\u8d44\u4e8b\u4e1a\u90e8\u201d)-3)<\/p>\n
\u7ed3\u679c\uff1a\u6210\u90fd\u878d\u8d44<\/p>\n","protected":false},"excerpt":{"rendered":"1\u3001left\uff08name,4\uff09\u622a\u53d6\u5de6\u8fb9\u76844\u4e2a\u5b57\u7b26\u5217\uff1aSELECTLEFT(201809,4)\u5e74\u7ed3\u679c\uff1a20182\u3001right\uff08name,2\uff09\u622a\u53d6\u53f3\u8fb9\u76842\u4e2a\u5b57\u7b26SELECTRIGHT(...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/356"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}