{"id":92,"date":"2023-02-12T16:35:50","date_gmt":"2023-05-30T06:53:10","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/index.php\/2023\/11\/30\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/"},"modified":"2025-07-31T22:45:52","modified_gmt":"2025-07-31T14:45:52","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/","title":{"rendered":"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528"},"content":{"rendered":"<h3>\u5f15\u8a00<\/h3>\n<p>\u5f53\u4f7f\u7528\u5173\u7cfb\u578b\u6570\u636e\u5e93\u548c\u7ed3\u6784\u5316\u67e5\u8be2\u8bed\u8a00\uff08SQL\uff09\u65f6\uff0c\u60a8\u53ef\u4ee5\u4ece\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08RDBMS\uff09\u4e2d\u5b58\u50a8\u3001\u7ba1\u7406\u548c\u68c0\u7d22\u6570\u636e\u3002SQL\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u4e2d\u68c0\u7d22\u6570\u636e\uff0c\u5e76\u4fdd\u6301\u5176\u539f\u59cb\u683c\u5f0f\u3002<\/p>\n<p>SQL\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u51fd\u6570\u8fdb\u884c\u6570\u636e\u8ba1\u7b97\u548c\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u5c06\u4ea7\u54c1\u4ef7\u683c\u56db\u820d\u4e94\u5165\u5230\u6700\u63a5\u8fd1\u7684\u7f8e\u5143\uff0c\u8ba1\u7b97\u5e73\u5747\u8d2d\u4e70\u4ea7\u54c1\u6570\u91cf\uff0c\u6216\u786e\u5b9a\u7ed9\u5b9a\u8d2d\u4e70\u7684\u4fdd\u4fee\u671f\u5230\u671f\u524d\u7684\u5929\u6570\u3002<\/p>\n<p>\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u60a8\u5c06\u4f7f\u7528\u4e0d\u540c\u7684SQL\u51fd\u6570\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\uff0c\u64cd\u4f5c\u5b57\u7b26\u4e32\u548c\u65e5\u671f\uff0c\u5e76\u4f7f\u7528\u805a\u5408\u51fd\u6570\u8ba1\u7b97\u6c47\u603b\u4fe1\u606f\u3002<\/p>\n<h2>\u5148\u51b3\u6761\u4ef6<\/h2>\n<p>\u8981\u6309\u7167\u672c\u6307\u5357\u7684\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff0c\u60a8\u9700\u8981\u4e00\u53f0\u5b89\u88c5\u4e86\u57fa\u4e8eSQL\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08RDBMS\uff09\u7684\u8ba1\u7b97\u673a\u3002\u672c\u6307\u5357\u4e2d\u7684\u6307\u4ee4\u548c\u793a\u4f8b\u5df2\u5728\u4ee5\u4e0b\u73af\u5883\u4e0b\u9a8c\u8bc1\uff1a<\/p>\n<ul>\n<li>\u4e00\u53f0\u8fd0\u884c Ubuntu 20.04 \u7684\u670d\u52a1\u5668\uff0c\u62e5\u6709\u5177\u5907\u7ba1\u7406\u6743\u9650\u7684\u975eroot\u7528\u6237\uff0c\u5e76\u5df2\u914d\u7f6eUFW\u9632\u706b\u5899\uff0c\u8be6\u60c5\u8bf7\u53c2\u9605\u6211\u4eec\u7684<a href=\"#\">Ubuntu 20.04\u521d\u59cb\u670d\u52a1\u5668\u8bbe\u7f6e\u6307\u5357<\/a>\u3002<\/li>\n<li>\u670d\u52a1\u5668\u4e0a\u5df2\u5b89\u88c5\u5e76\u5b89\u5168\u914d\u7f6eMySQL\uff0c\u8be6\u60c5\u8bf7\u53c2\u9605<a href=\"#\">\u5982\u4f55\u5728Ubuntu 20.04\u4e0a\u5b89\u88c5MySQL<\/a>\u3002\u672c\u6307\u5357\u5df2\u901a\u8fc7\u4e00\u4e2a\u975eroot\u7684MySQL\u7528\u6237\u8fdb\u884c\u9a8c\u8bc1\uff0c\u8be5\u7528\u6237\u662f\u6309\u7167\u7b2c3\u6b65\u63cf\u8ff0\u7684\u8fc7\u7a0b\u521b\u5efa\u7684\u3002<\/li>\n<li>\u5bf9\u6267\u884c<code>SELECT<\/code>\u67e5\u8be2\u4ee5\u4ece\u6570\u636e\u5e93\u4e2d\u9009\u62e9\u6570\u636e\u6709\u57fa\u672c\u4e86\u89e3\uff0c\u8be6\u60c5\u8bf7\u53c2\u9605\u6211\u4eec\u7684<a href=\"#\">\u5982\u4f55\u5728SQL\u4e2d\u4ece\u8868\u4e2d\u9009\u62e9\u884c\u6307\u5357<\/a>\u3002<\/li>\n<\/ul>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\"><strong>\u6ce8\u610f\uff1a<\/strong>\u8bb8\u591a\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u90fd\u4f7f\u7528\u81ea\u5df1\u7684SQL\u5b9e\u73b0\u3002\u5c3d\u7ba1\u672c\u6559\u7a0b\u4e2d\u63d0\u5230\u7684\u547d\u4ee4\u5728\u5927\u591a\u6570\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\u90fd\u80fd\u6b63\u5e38\u8fd0\u884c\uff0c\u4f46\u6807\u51c6SQL\u8bed\u6cd5\u53ea\u6307\u5b9a\u4e86\u6709\u9650\u6570\u91cf\u7684\u51fd\u6570\u3002\u800c\u4e14\uff0c\u5bf9\u6807\u51c6\u8bed\u6cd5\u7684\u652f\u6301\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u5f15\u64ce\u4e2d\u4f1a\u6709\u6240\u4e0d\u540c\u3002\u5982\u679c\u60a8\u5728\u4e0eMySQL\u4e0d\u540c\u7684\u7cfb\u7edf\u4e0a\u8fdb\u884c\u6d4b\u8bd5\uff0c\u786e\u5207\u7684\u8bed\u6cd5\u6216\u8f93\u51fa\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\u3002\u60a8\u8fd8\u9700\u8981\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e9b\u52a0\u8f7d\u4e86\u793a\u4f8b\u6570\u636e\u7684\u8868\u683c\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u7ec3\u4e60\u4f7f\u7528\u51fd\u6570\u3002\u6211\u4eec\u9f13\u52b1\u60a8\u67e5\u9605\u4ee5\u4e0b\u201c\u8fde\u63a5\u5230MySQL\u5e76\u8bbe\u7f6e\u793a\u4f8b\u6570\u636e\u5e93\u201d\u90e8\u5206\uff0c\u8be6\u7ec6\u4e86\u89e3\u5982\u4f55\u8fde\u63a5\u5230MySQL\u670d\u52a1\u5668\u4ee5\u53ca\u5982\u4f55\u521b\u5efa\u672c\u6307\u5357\u4e2d\u793a\u4f8b\u6240\u4f7f\u7528\u7684\u6d4b\u8bd5\u6570\u636e\u5e93\u3002<\/p>\n<\/div>\n<h2>\u8fde\u63a5\u5230MySQL\u5e76\u8bbe\u7f6e\u793a\u4f8b\u6570\u636e\u5e93<\/h2>\n<p>\u5728\u8fd9\u4e00\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u8fde\u63a5\u5230\u4e00\u4e2aMySQL\u670d\u52a1\u5668\u5e76\u521b\u5efa\u4e00\u4e2a\u793a\u4f8b\u6570\u636e\u5e93\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u6309\u7167\u672c\u6307\u5357\u4e2d\u7684\u793a\u4f8b\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<p>\u5982\u679c\u60a8\u7684SQL\u6570\u636e\u5e93\u7cfb\u7edf\u8fd0\u884c\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\uff0c\u90a3\u4e48\u4ece\u60a8\u7684\u672c\u5730\u673a\u5668\u901a\u8fc7SSH\u767b\u5f55\u5230\u60a8\u7684\u670d\u52a1\u5668\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token function\">ssh<\/span> <mark>sammy<\/mark>@<mark>your_server_ip<\/mark><\/code><\/pre>\n<p>\u7136\u540e\u6253\u5f00MySQL\u670d\u52a1\u5668\u63d0\u793a\u7b26\uff0c\u5c06<code>sammy<\/code>\u66ff\u6362\u4e3a\u60a8\u7684MySQL\u7528\u6237\u8d26\u6237\u7684\u540d\u79f0\u3002<\/p>\n<pre class=\"post-pre\"><code>mysql <span class=\"token parameter variable\">-u<\/span> <mark>sammy<\/mark> <span class=\"token parameter variable\">-p<\/span><\/code><\/pre>\n<p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>bookstore<\/code>\u7684\u6570\u636e\u5e93\u3002<\/p>\n<pre class=\"post-pre\"><code>CREATE DATABASE bookstore;<\/code><\/pre>\n<p>\u5982\u679c\u6570\u636e\u5e93\u521b\u5efa\u6210\u529f\uff0c\u60a8\u5c06\u6536\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u8f93\u51fa\uff1a<\/p>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>Query OK, 1 row affected (0.01 sec)<\/code><\/pre>\n<p>\u8981\u9009\u62e9<code>bookstore<\/code>\u6570\u636e\u5e93\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b<code>USE<\/code>\u8bed\u53e5\uff1a<\/p>\n<pre class=\"post-pre\"><code>USE bookstore;<\/code><\/pre>\n<p>\u60a8\u5c06\u6536\u5230\u4ee5\u4e0b\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Database changed<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u9009\u62e9\u6570\u636e\u5e93\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u521b\u5efa\u793a\u4f8b\u8868\u3002\u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a\u865a\u6784\u7684\u4e66\u5e97\u4f5c\u4e3a\u4f8b\u5b50\uff0c\u8be5\u4e66\u5e97\u9500\u552e\u4e0d\u540c\u4f5c\u8005\u7684\u56fe\u4e66\u3002<\/p>\n<p>\u56fe\u4e66\u9986\u5b58\u8d27\u8868\u5c06\u5305\u542b\u5173\u4e8e\u4e66\u5e97\u56fe\u4e66\u7684\u6570\u636e\u3002\u5b83\u5c06\u5305\u542b\u4ee5\u4e0b\u5217\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>book_id: This column holds the identifier for each book, represented by the int data type. This column will become the table\u2019s primary key, with each value becoming a unique identifier for its respective row.<\/li>\n<li>author: This column holds the book author\u2019s name, expressed using the varchar data type with a maximum of 50 characters.<\/li>\n<li>title: This column holds the purchased book\u2019s title, expressed using the varchar data type with a maximum of 200 characters.<\/li>\n<li>introduction_date: Using the date data type, this column holds the date each book was introduced by the bookstore.<\/li>\n<li>stock: This column holds the number of books the bookstore has in its inventory using the int integer data type.<\/li>\n<li>price: This column stores the book\u2019s retail price using the decimal data type with a maximum of 5 values before the decimal point and 2 values after it.<\/li>\n<\/ul>\n<p>\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u793a\u4f8b\u8868\u683c\uff1a\u521b\u5efa\u6837\u672c\u8868\u683c\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TABLE inventory <span class=\"token punctuation\">(<\/span><\/li>\n<li data-prefix=\"mysql&gt;\">book_id int,<\/li>\n<li data-prefix=\"mysql&gt;\">author varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\">title varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">200<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\">introduction_date date,<\/li>\n<li data-prefix=\"mysql&gt;\">stock int,<\/li>\n<li data-prefix=\"mysql&gt;\">price decimal<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span>, <span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\">PRIMARY KEY <span class=\"token punctuation\">(<\/span>book_id<span class=\"token punctuation\">)<\/span><\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5982\u679c\u6253\u5370\u51fa\u4ee5\u4e0b\u8f93\u51fa\u7ed3\u679c\uff0c\u5219\u8868\u793a\u8868\u5df2\u88ab\u521b\u5efa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 rows affected (0.00 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u968f\u540e\uff0c\u901a\u8fc7\u8fd0\u884c\u4ee5\u4e0bINSERT INTO\u64cd\u4f5c\uff0c\u7528\u4e00\u4e9b\u6837\u672c\u6570\u636e\u52a0\u8f7d\u8d2d\u4e70\u8868\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">INSERT INTO inventory<\/li>\n<li data-prefix=\"mysql&gt;\">VALUES<\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span>, <span class=\"token string\">&#8216;Oscar Wilde&#8217;<\/span>, <span class=\"token string\">&#8216;The Picture of Dorian Gray&#8217;<\/span>, <span class=\"token string\">&#8216;2022-10-01&#8217;<\/span>, <span class=\"token number\">4<\/span>, <span class=\"token number\">20.83<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">(<\/span><span class=\"token number\">2<\/span>, <span class=\"token string\">&#8216;Jane Austen&#8217;<\/span>, <span class=\"token string\">&#8216;Pride and Prejudice&#8217;<\/span>, <span class=\"token string\">&#8216;2022-10-04&#8217;<\/span>, <span class=\"token number\">12<\/span>, <span class=\"token number\">42.13<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">(<\/span><span class=\"token number\">3<\/span>, <span class=\"token string\">&#8216;Herbert George Wells&#8217;<\/span>, <span class=\"token string\">&#8216;The Time Machine&#8217;<\/span>, <span class=\"token string\">&#8216;2022-09-23&#8217;<\/span>, <span class=\"token number\">7<\/span>, <span class=\"token number\">21.99<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">(<\/span><span class=\"token number\">4<\/span>, <span class=\"token string\">&#8216;Mary Shelley&#8217;<\/span>, <span class=\"token string\">&#8216;Frankenstein&#8217;<\/span>, <span class=\"token string\">&#8216;2022-07-23&#8217;<\/span>, <span class=\"token number\">9<\/span>, <span class=\"token number\">17.43<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span>, <span class=\"token string\">&#8216;Mark Twain&#8217;<\/span>, <span class=\"token string\">&#8216;The Adventures of Huckleberry Finn&#8217;<\/span>, <span class=\"token string\">&#8216;2022-10-01&#8217;<\/span>, <span class=\"token number\">14<\/span>, <span class=\"token number\">23.15<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u63d2\u5165\u64cd\u4f5c\u5c06\u4f7f\u7528\u6307\u5b9a\u7684\u503c\u5411\u5e93\u5b58\u8868\u4e2d\u6dfb\u52a0\u4e94\u672c\u4e66\u3002\u4e0b\u9762\u7684\u8f93\u51fa\u8868\u793a\u5df2\u7ecf\u6dfb\u52a0\u4e86\u6240\u6709\u4e94\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/p>\n<p>\u8fd9\u662f\u6587\u7ae0\u300a\u5982\u4f55\u5728SQL\u4e2d\u4f7f\u7528\u51fd\u6570\u300b\u7684\u7b2c3\u90e8\u5206\uff08\u51716\u90e8\u5206\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code>Query OK, 5 rows affected (0.00 sec)\r\nRecords: 5 Duplicates: 0 Warnings: 0<\/code><\/pre>\n<p>\u968f\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u6309\u7167\u5269\u4e0b\u7684\u6307\u5357\uff0c\u5f00\u59cb\u5728SQL\u4e2d\u4f7f\u7528\u51fd\u6570\u4e86\u3002<\/p>\n<h2>\u7406\u89e3SQL\u51fd\u6570<\/h2>\n<p>\u51fd\u6570\u662f\u5177\u6709\u540d\u79f0\u7684\u8868\u8fbe\u5f0f\uff0c\u5b83\u4eec\u63a5\u53d7\u4e00\u4e2a\u6216\u591a\u4e2a\u503c\uff0c\u5728\u6570\u636e\u4e0a\u6267\u884c\u8ba1\u7b97\u6216\u8f6c\u6362\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u65b0\u503c\u4f5c\u4e3a\u7ed3\u679c\u3002\u60a8\u53ef\u4ee5\u5c06SQL\u51fd\u6570\u7c7b\u6bd4\u4e8e\u6570\u5b66\u4e2d\u7684\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u51fd\u6570<code>log(x)<\/code>\u63a5\u53d7\u4e00\u4e2a<code>x<\/code>\u5e76\u8fd4\u56de<code>x<\/code>\u7684\u5bf9\u6570\u503c\u3002<\/p>\n<p>\u901a\u5e38\uff0c\u4ece\u5173\u7cfb\u6570\u636e\u5e93\u4e2d\u68c0\u7d22\u4fe1\u606f\uff08\u4e0d\u8fdb\u884c\u8f6c\u6362\uff09\uff0c\u60a8\u4f1a\u4f7f\u7528<code>SELECT<\/code>\u67e5\u8be2\uff0c\u901a\u8fc7\u5728\u8bed\u53e5\u4e2d\u6307\u5b9a\u5217\u540d\u6765\u8981\u6c42\u6570\u636e\u5e93\u8fd4\u56de\u60a8\u611f\u5174\u8da3\u7684\u5404\u4e2a\u5217\u7684\u503c\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u68c0\u7d22\u6240\u6709\u4e66\u7c4d\u7684\u6807\u9898\u548c\u4ef7\u683c\uff0c\u5e76\u6309\u7167\u4ece\u6700\u8d35\u5230\u6700\u4fbf\u5b9c\u7684\u987a\u5e8f\u6392\u5217\uff0c\u60a8\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol>\r\n \t<li data-prefix=\"mysql&gt;\">SELECT <mark>title<\/mark>, <mark>price<\/mark>, <mark>introduction_date<\/mark> FROM inventory ORDER BY price DESC;<\/li>\r\n<\/ol><\/code><\/pre>\n<p>\u60a8\u5c06\u4f1a\u6536\u5230\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>+------------------------------------+-------+-------------------+\r\n| title                              | price | introduction_date |\r\n+------------------------------------+-------+-------------------+\r\n| Pride and Prejudice                | 42.13 | 2022-10-04        |\r\n| The Adventures of Huckleberry Finn | 23.15 | 2022-10-01        |\r\n| The Time Machine                   | 21.99 | 2022-09-23        |\r\n| The Picture of Dorian Gray         | 20.83 | 2022-10-01        |\r\n| Frankenstein                       | 17.43 | 2022-07-23        |\r\n+------------------------------------+-------+-------------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<p>\u5728\u6b64\u8bed\u53e5\u4e2d\uff0c\u6807\u9898\u3001\u4ef7\u683c\u548c\u5f15\u5165\u65e5\u671f\u662f\u5217\u540d\u3002\u5728\u8f93\u51fa\u7ed3\u679c\u4e2d\uff0c\u6570\u636e\u5e93\u5448\u73b0\u4e86\u6bcf\u672c\u4e66\u4ece\u8fd9\u4e9b\u5217\u4e2d\u68c0\u7d22\u5230\u7684\u5b8c\u6574\u4e66\u540d\u3001\u4ef7\u683c\u4ee5\u53ca\u4e66\u7c4d\u8fdb\u5165\u4e66\u5e97\u7684\u65e5\u671f\u3002<\/p>\n<p>\u7136\u800c\uff0c\u60a8\u53ef\u80fd\u4e5f\u60f3\u5728\u67d0\u79cd\u5f62\u5f0f\u7684\u5904\u7406\u6216\u64cd\u4f5c\u540e\u4ece\u6570\u636e\u5e93\u4e2d\u63d0\u53d6\u6570\u636e\u3002\u60a8\u53ef\u80fd\u5bf9\u4ee5\u6700\u63a5\u8fd1\u7684\u4e00\u7f8e\u5143\u4e3a\u5355\u4f4d\u8fdb\u884c\u56db\u820d\u4e94\u5165\u7684\u4e66\u7c4d\u4ef7\u683c\u611f\u5174\u8da3\uff0c\u5bf9\u4e66\u540d\u91c7\u7528\u5927\u5199\u663e\u793a\uff0c\u6216\u8005\u53ea\u9700\u8981\u4ecb\u7ecd\u5e74\u4efd\uff0c\u4e0d\u5305\u62ec\u6708\u4efd\u6216\u65e5\u671f\u3002\u8fd9\u65f6\u5019\u60a8\u5c06\u4f7f\u7528\u4e00\u4e2a\u51fd\u6570\u3002<\/p>\n<p>\u6839\u636e\u5b83\u4eec\u64cd\u4f5c\u7684\u6570\u636e\u7c7b\u578b\uff0cSQL\u51fd\u6570\u53ef\u4ee5\u5927\u81f4\u5206\u4e3a\u51e0\u4e2a\u7c7b\u522b\u3002\u4ee5\u4e0b\u662f\u6700\u5e38\u7528\u7684\u51fd\u6570\uff1a<\/p>\n<ul class=\"post-ul\">\n<li><strong>\u6570\u5b66\u51fd\u6570\uff08Mathematical Functions\uff09\uff1a<\/strong> \u5bf9\u6570\u503c\u8fdb\u884c\u64cd\u4f5c\u5e76\u6267\u884c\u8ba1\u7b97\u7684\u51fd\u6570\uff0c\u4f8b\u5982\u56db\u820d\u4e94\u5165\u3001\u5bf9\u6570\u3001\u5e73\u65b9\u6839\u6216\u5e42\u8fd0\u7b97\u3002<\/li>\n<li><strong>\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570\uff08String Manipulation Functions\uff09\uff1a<\/strong> \u5bf9\u5b57\u7b26\u4e32\u548c\u6587\u672c\u5b57\u6bb5\u8fdb\u884c\u64cd\u4f5c\u7684\u51fd\u6570\uff0c\u6267\u884c\u6587\u672c\u8f6c\u6362\uff0c\u4f8b\u5982\u5c06\u6587\u672c\u8f6c\u6362\u4e3a\u5927\u5199\u3001\u4fee\u526a\u6216\u66ff\u6362\u503c\u4e2d\u7684\u5355\u8bcd\u3002<\/li>\n<li><strong>\u65e5\u671f\u548c\u65f6\u95f4\u51fd\u6570\uff08Date and Time Functions\uff09\uff1a<\/strong> \u5bf9\u5305\u542b\u65e5\u671f\u7684\u5b57\u6bb5\u8fdb\u884c\u64cd\u4f5c\u7684\u51fd\u6570\u3002\u8fd9\u4e9b\u51fd\u6570\u6267\u884c\u8ba1\u7b97\u548c\u8f6c\u6362\uff0c\u4f8b\u5982\u5c06\u5929\u6570\u6dfb\u52a0\u5230\u7ed9\u5b9a\u65e5\u671f\u6216\u4ec5\u4ece\u5b8c\u6574\u65e5\u671f\u4e2d\u63d0\u53d6\u5e74\u4efd\u3002<\/li>\n<li><strong>\u805a\u5408\u51fd\u6570\uff08Aggregate Functions\uff09\uff1a<\/strong> \u4e00\u79cd\u7279\u6b8a\u7684\u6570\u5b66\u51fd\u6570\uff0c\u5bf9\u6765\u81ea\u591a\u884c\u7684\u6570\u636e\u8fdb\u884c\u64cd\u4f5c\uff0c\u4f8b\u5982\u8ba1\u7b97\u6240\u6709\u884c\u7684\u5e73\u5747\u4ef7\u683c\u3002<\/li>\n<\/ul>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">\u6ce8\u610f\uff1a\u5927\u591a\u6570\u5173\u7cfb\u6570\u636e\u5e93\uff0c\u5305\u62ecMySQL\uff0c\u5728SQL\u6807\u51c6\u5b9a\u4e49\u7684\u57fa\u672c\u51fd\u6570\u96c6\u4e4b\u5916\uff0c\u8fd8\u6dfb\u52a0\u4e86\u7279\u5b9a\u4e8e\u8be5\u6570\u636e\u5e93\u5f15\u64ce\u7684\u989d\u5916\u64cd\u4f5c\u3002\u8bb8\u591aSQL\u6807\u51c6\u4e4b\u5916\u7684\u51fd\u6570\u5728\u8bb8\u591a\u6570\u636e\u5e93\u4e2d\u7684\u5de5\u4f5c\u65b9\u5f0f\u76f8\u4f3c\uff0c\u800c\u5176\u4ed6\u51fd\u6570\u5219\u9650\u4e8e\u7279\u5b9a\u7684\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08RDBMS\uff09\u53ca\u5176\u72ec\u7279\u529f\u80fd\u3002\u60a8\u53ef\u4ee5\u67e5\u9605\u6240\u9009\u62e9\u6570\u636e\u5e93\u7684\u6587\u6863\u4ee5\u4e86\u89e3\u6570\u636e\u5e93\u63d0\u4f9b\u7684\u51fd\u6570\u3002\u5bf9\u4e8eMySQL\uff0c\u60a8\u53ef\u4ee5\u5728\u201c\u5185\u7f6e\u51fd\u6570\u53ca\u8fd0\u7b97\u7b26\u53c2\u8003\u201d\u4e2d\u83b7\u5f97\u66f4\u591a\u4fe1\u606f\u3002\u4ee5\u4e0b\u793a\u4f8b\u5c55\u793a\u4e86\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a<code>EXAMPLE<\/code>\u7684\u865a\u6784\u4e14\u4e0d\u5b58\u5728\u7684\u51fd\u6570\u6765\u6539\u53d8\u4e66\u5e97\u5e93\u5b58\u6570\u636e\u5e93\u4e2d\u4ef7\u683c\u503c\u7684<code>SELECT<\/code>\u67e5\u8be2\u7684\u4e00\u822c\u8bed\u6cd5\u3002<\/p>\n<pre class=\"post-pre\"><code><ol>\r\n \t<li data-prefix=\"mysql&gt;\">SELECT <mark>EXAMPLE(price) AS new_price<\/mark> FROM inventory;<\/li>\r\n<\/ol><\/code><\/pre>\n<\/div>\n<p>\u51fd\u6570\uff08<code>EXAMPLE<\/code>\uff09\u4ee5\u62ec\u53f7\u62ec\u8d77\u6765\u7684\u5217\u540d\uff08<code>price<\/code>\uff09\u4f5c\u4e3a\u53c2\u6570\u3002\u67e5\u8be2\u7684\u8fd9\u90e8\u5206\u544a\u8bc9\u6570\u636e\u5e93\u6267\u884c\u51fd\u6570<code>EXAMPLE<\/code>\u5728\u5217<code>price<\/code>\u7684\u503c\u4e0a\uff0c\u5e76\u8fd4\u56de\u6b64\u64cd\u4f5c\u7684\u7ed3\u679c\u3002<code>AS new_price<\/code>\u544a\u8bc9\u6570\u636e\u5e93\u5728\u67e5\u8be2\u671f\u95f4\u4e3a\u8ba1\u7b97\u7684\u503c\u5206\u914d\u4e00\u4e2a\u4e34\u65f6\u540d\u79f0\uff08<code>new_price<\/code>\uff09\u3002\u901a\u8fc7\u8fd9\u6837\u505a\uff0c\u60a8\u53ef\u4ee5\u5728\u8f93\u51fa\u4e2d\u533a\u5206\u51fd\u6570\u7684\u7ed3\u679c\uff0c\u5e76\u53ef\u4ee5\u4f7f\u7528<code>WHERE<\/code>\u548c<code>ORDER BY<\/code>\u5b50\u53e5\u5f15\u7528\u8ba1\u7b97\u7684\u503c\u3002<\/p>\n<p>\u5728\u63a5\u4e0b\u6765\u7684\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u4f7f\u7528\u6570\u5b66\u51fd\u6570\u6765\u8fdb\u884c\u5e38\u7528\u8ba1\u7b97\u3002<\/p>\n<h2>\u4f7f\u7528\u6570\u5b66\u51fd\u6570<\/h2>\n<p>\u6570\u5b66\u51fd\u6570\u5bf9\u6570\u5b57\u503c\u8fdb\u884c\u64cd\u4f5c\uff0c\u6bd4\u5982\u6837\u672c\u6570\u636e\u5e93\u4e2d\u7684\u4e66\u4ef7\u6216\u5e93\u5b58\u91cf\u3002\u5b83\u4eec\u53ef\u7528\u4e8e\u5728\u6570\u636e\u5e93\u4e2d\u6267\u884c\u8ba1\u7b97\uff0c\u4ee5\u4fbf\u4f7f\u7ed3\u679c\u7b26\u5408\u60a8\u7684\u9700\u6c42\u3002<\/p>\n<p>\u56db\u820d\u4e94\u5165\u662fSQL\u4e2d\u6700\u5e38\u7528\u7684\u6570\u5b66\u51fd\u6570\u4e4b\u4e00\u3002\u60f3\u8c61\u4e00\u4e0b\uff0c\u4f60\u9700\u8981\u68c0\u7d22\u6240\u6709\u4e66\u7c4d\u7684\u4ef7\u683c\uff0c\u4f46\u4f60\u53ea\u5173\u6ce8\u88ab\u56db\u820d\u4e94\u5165\u5230\u6700\u63a5\u8fd1\u7684\u6574\u7f8e\u5143\u7684\u4ef7\u503c\u3002\u4e3a\u4e86\u8fbe\u5230\u8fd9\u4e2a\u76ee\u7684\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>ROUND<\/code>\u51fd\u6570\u6765\u6267\u884c\u56db\u820d\u4e94\u5165\u64cd\u4f5c\u3002<\/p>\n<p>\u5c1d\u8bd5\u6267\u884c\u4ee5\u4e0b\u58f0\u660e\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol>\r\n \t<li data-prefix=\"mysql&gt;\">SELECT title, price, <mark>ROUND(price) AS rounded_price<\/mark> FROM inventory;<\/li>\r\n<\/ol><\/code><\/pre>\n<p>\u4ee5\u4e0b\u5185\u5bb9\u5c06\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff1a<\/p>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<p>\u8fd9\u662f\u6587\u7ae0\u300a\u5982\u4f55\u5728SQL\u4e2d\u4f7f\u7528\u51fd\u6570\u300b\u7684\u7b2c4\u90e8\u5206\uff08\u51716\u90e8\u5206\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code>+------------------------------------+-------+---------------+\r\n| title                              | price | rounded_price |\r\n+------------------------------------+-------+---------------+\r\n| The Picture of Dorian Gray         | 20.83 |            21 |\r\n| Pride and Prejudice                | 42.13 |            42 |\r\n| The Time Machine                   | 21.99 |            22 |\r\n| Frankenstein                       | 17.43 |            17 |\r\n| The Adventures of Huckleberry Finn | 23.15 |            23 |\r\n+------------------------------------+-------+---------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e0a\u8ff0\u67e5\u8be2\u4ece<code>title<\/code>\uff08\u6807\u9898\uff09\u548c<code>price<\/code>\uff08\u4ef7\u683c\uff09\u5217\u4e2d\u9009\u53d6\u503c\uff0c\u540c\u65f6\u9009\u62e9\u4e00\u4e2a\u4e34\u65f6\u7684<code>rounded_price<\/code>\u5217\uff0c\u8be5\u5217\u5305\u542b\u4f7f\u7528<code>ROUND(price)<\/code>\u51fd\u6570\u8fd4\u56de\u7684\u7ed3\u679c\u3002\u8be5\u51fd\u6570\u63a5\u53d7\u4e00\u4e2a\u53c2\u6570\uff0c\u5373\u5217\u540d\uff08\u5728\u6b64\u60c5\u51b5\u4e0b\u662f<code>price<\/code>\uff09\uff0c\u5e76\u8fd4\u56de\u8868\u4e2d\u8be5\u5217\u7684\u503c\u56db\u820d\u4e94\u5165\u5230\u6700\u8fd1\u7684\u6574\u6570\u3002<\/p>\n<p>\u53d6\u6574\u51fd\u6570\u8fd8\u53ef\u4ee5\u63a5\u53d7\u989d\u5916\u7684\u53c2\u6570\uff0c\u8be5\u53c2\u6570\u5b9a\u4e49\u820d\u5165\u7684\u5c0f\u6570\u4f4d\u6570\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u8fdb\u884c\u7b97\u672f\u8fd0\u7b97\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u5355\u4e2a\u5217\u540d\u3002\u4f8b\u5982\uff0c\u5c1d\u8bd5\u8fd0\u884c\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT title, price, <mark>ROUND<span class=\"token punctuation\">(<\/span>price * stock, <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> AS stock_price<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u60a8\u5c06\u6536\u5230\u4ee5\u4e0b\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>+------------------------------------+-------+-------+-------------+\r\n| title                              | stock | price | stock_price |\r\n+------------------------------------+-------+-------+-------------+\r\n| The Picture of Dorian Gray         |     4 | 20.83 |        83.3 |\r\n| Pride and Prejudice                |    12 | 42.13 |       505.6 |\r\n| The Time Machine                   |     7 | 21.99 |       153.9 |\r\n| Frankenstein                       |     9 | 17.43 |       156.9 |\r\n| The Adventures of Huckleberry Finn |    14 | 23.15 |       324.1 |\r\n+------------------------------------+-------+-------+-------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4f7f\u7528<code>ROUND(price * stock, 1)<\/code>\u5c06\u9996\u5148\u5c06\u5355\u672c\u4e66\u7684\u4ef7\u683c\u4e0e\u5e93\u5b58\u4e2d\u7684\u4e66\u7c4d\u6570\u91cf\u76f8\u4e58\uff0c\u7136\u540e\u5c06\u7ed3\u679c\u56db\u820d\u4e94\u5165\u81f3\u5c0f\u6570\u70b9\u540e\u4e00\u4f4d\u3002\u7ed3\u679c\u5c06\u5448\u73b0\u5728\u201cstock_price\u201d\u4e34\u65f6\u5217\u4e2d\u3002<\/p>\n<p>\u5176\u4ed6\u5d4c\u5165\u5230MySQL\u4e2d\u7684\u6570\u5b66\u51fd\u6570\u5305\u62ec\u4e09\u89d2\u51fd\u6570\u3001\u5e73\u65b9\u6839\u3001\u5e42\u51fd\u6570\u3001\u5bf9\u6570\u548c\u6307\u6570\u51fd\u6570\u3002\u60a8\u53ef\u4ee5\u5728\u300a\u5982\u4f55\u5728SQL\u4e2d\u4f7f\u7528\u6570\u5b66\u8868\u8fbe\u5f0f\u548c\u805a\u5408\u51fd\u6570\u300b\u6559\u7a0b\u4e2d\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u5728SQL\u4e2d\u4f7f\u7528\u6570\u5b66\u51fd\u6570\u7684\u5185\u5bb9\u3002<\/p>\n<p>\u5728\u63a5\u4e0b\u6765\u7684\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u4f7f\u7528SQL\u51fd\u6570\u6765\u64cd\u4f5c\u6570\u636e\u5e93\u4e2d\u7684\u6587\u672c\u3002<\/p>\n<h2>\u4f7f\u7528\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570<\/h2>\n<p>SQL\u4e2d\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570\u53ef\u4ee5\u5728\u5904\u7406SQL\u67e5\u8be2\u65f6\u6539\u53d8\u5b58\u50a8\u5728\u6587\u672c\u5217\u4e2d\u7684\u503c\u3002\u5b83\u4eec\u53ef\u4ee5\u7528\u4e8e\u8f6c\u6362\u5927\u5c0f\u5199\u3001\u5c06\u591a\u4e2a\u5217\u7684\u6570\u636e\u8fde\u63a5\u8d77\u6765\u6216\u6267\u884c\u641c\u7d22\u548c\u66ff\u6362\u64cd\u4f5c\u7b49\u3002<\/p>\n<p>\u60a8\u5c06\u901a\u8fc7\u68c0\u7d22\u6240\u6709\u8f6c\u6362\u4e3a\u5c0f\u5199\u7684\u4e66\u540d\u6765\u5f00\u59cb\u4f7f\u7528\u5b57\u7b26\u4e32\u51fd\u6570\u3002\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT <mark>LOWER<span class=\"token punctuation\">(<\/span>title<span class=\"token punctuation\">)<\/span> AS title_lowercase<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u8f93\u51fa\u5c06\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>+------------------------------------+\r\n| title_lowercase                    |\r\n+------------------------------------+\r\n| the picture of dorian gray         |\r\n| pride and prejudice                |\r\n| the time machine                   |\r\n| frankenstein                       |\r\n| the adventures of huckleberry finn |\r\n+------------------------------------+\r\n5 rows in set (0.001 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>SQL\u51fd\u6570<code>LOWER<\/code>\u63a5\u53d7\u4e00\u4e2a\u53c2\u6570\u5e76\u5c06\u5176\u5185\u5bb9\u8f6c\u6362\u4e3a\u5c0f\u5199\u3002\u901a\u8fc7\u5217\u522b\u540d<code>AS title_lowercase<\/code>\uff0c\u7ed3\u679c\u6570\u636e\u4ee5\u4e34\u65f6\u5217<code>title_lowercase<\/code>\u7684\u5f62\u5f0f\u5448\u73b0\u3002<\/p>\n<p>\u73b0\u5728\u68c0\u7d22\u6240\u6709\u4f5c\u8005\uff0c\u8fd9\u6b21\u5c06\u5b83\u4eec\u8f6c\u6362\u4e3a\u5927\u5199\u5b57\u6bcd\u3002\u5c1d\u8bd5\u8fd0\u884c\u4ee5\u4e0b SQL \u67e5\u8be2\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT <mark>UPPER<span class=\"token punctuation\">(<\/span>author<span class=\"token punctuation\">)<\/span> AS author_uppercase<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u60a8\u5c06\u6536\u5230\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>+----------------------+\r\n| author_uppercase     |\r\n+----------------------+\r\n| OSCAR WILDE          |\r\n| JANE AUSTEN          |\r\n| HERBERT GEORGE WELLS |\r\n| MARY SHELLEY         |\r\n| MARK TWAIN           |\r\n+----------------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u60a8\u4f7f\u7528\u4e86<code>UPPER<\/code>\u51fd\u6570\u4ee3\u66ff<code>LOWER<\/code>\u51fd\u6570\uff0c\u5b83\u4eec\u7684\u529f\u80fd\u76f8\u4f3c\uff0c\u90fd\u5c06\u6587\u672c\u8f6c\u6362\u4e3a\u5927\u5199\u3002\u5982\u679c\u60a8\u60f3\u5728\u68c0\u7d22\u6570\u636e\u65f6\u786e\u4fdd\u5b57\u7b26\u7684\u5927\u5c0f\u5199\u4e00\u81f4\u6027\uff0c\u8fd9\u4e24\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n<p>\u53e6\u4e00\u4e2a\u6709\u7528\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\u51fd\u6570\u662f<code>CONCAT<\/code>\uff0c\u5b83\u63a5\u53d7\u591a\u4e2a\u5305\u542b\u6587\u672c\u503c\u7684\u53c2\u6570\u5e76\u5c06\u5b83\u4eec\u5408\u5e76\u5728\u4e00\u8d77\u3002\u5c1d\u8bd5\u5728\u4e00\u4e2a\u5217\u4e2d\u68c0\u7d22\u4e66\u7c4d\u7684\u4f5c\u8005\u548c\u6807\u9898\u7684\u7ec4\u5408\u3002\u8981\u6267\u884c\u6b64\u64cd\u4f5c\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT <mark>CONCAT<span class=\"token punctuation\">(<\/span>author, <span class=\"token string\">&#8216;: &#8216;<\/span>, title<span class=\"token punctuation\">)<\/span> AS full_title<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8fd9\u4e2a\u58f0\u660e\u8fd4\u56de\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<p>\u8fd9\u662f\u6587\u7ae0\u300a\u5982\u4f55\u5728SQL\u4e2d\u4f7f\u7528\u51fd\u6570\u300b\u7684\u7b2c5\u90e8\u5206\uff08\u51716\u90e8\u5206\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code>+------------------------------------------------+\r\n| full_title                                     |\r\n+------------------------------------------------+\r\n| Oscar Wilde: The Picture of Dorian Gray        |\r\n| Jane Austen: Pride and Prejudice               |\r\n| Herbert George Wells: The Time Machine         |\r\n| Mary Shelley: Frankenstein                     |\r\n| Mark Twain: The Adventures of Huckleberry Finn |\r\n+------------------------------------------------+\r\n5 rows in set (0.001 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p><code>CONCAT<\/code>\u51fd\u6570\u7528\u4e8e\u8fde\u63a5\u591a\u4e2a\u5b57\u7b26\u4e32\uff0c\u5b83\u9700\u8981\u4e09\u4e2a\u53c2\u6570\u6765\u6267\u884c\u3002\u7b2c\u4e00\u4e2a\u53c2\u6570<code>author<\/code>\u6307\u7684\u662f\u5305\u542b\u4f5c\u8005\u59d3\u540d\u7684\u5217\u3002\u7b2c\u4e8c\u4e2a\u53c2\u6570<code>:<\/code>\u662f\u4e00\u4e2a\u4efb\u610f\u5b57\u7b26\u4e32\u503c\uff0c\u7528\u4f5c\u4f5c\u8005\u548c\u4e66\u540d\u4e4b\u95f4\u7684\u5206\u9694\u7b26\u3002\u6700\u540e\u4e00\u4e2a\u53c2\u6570<code>title<\/code>\u6307\u7684\u662f\u5305\u542b\u4e66\u540d\u7684\u5217\u3002<\/p>\n<p>\u5728\u6b64\u67e5\u8be2\u7684\u7ed3\u679c\u4e2d\uff0c\u4f5c\u8005\u548c\u6807\u9898\u88ab\u62fc\u63a5\u6210\u4e00\u4e2a\u540d\u4e3a<code>full_title<\/code>\u7684\u4e34\u65f6\u5217\uff0c\u7531\u6570\u636e\u5e93\u5f15\u64ce\u76f4\u63a5\u751f\u6210\u3002<\/p>\n<p>MySQL\u4e2d\u8fd8\u5185\u7f6e\u4e86\u5176\u4ed6\u4e00\u4e9b\u5b57\u7b26\u4e32\u51fd\u6570\uff0c\u7528\u4e8e\u641c\u7d22\u548c\u66ff\u6362\u5b57\u7b26\u4e32\u3001\u63d0\u53d6\u5b50\u5b57\u7b26\u4e32\u3001\u586b\u5145\u548c\u4fee\u526a\u5b57\u7b26\u4e32\u503c\u3001\u5e94\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u7b49\u7b49\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728SQL\u6559\u7a0b\u4e2d\u67e5\u627e\u5982\u4f55\u4f7f\u7528<code>CAST<\/code>\u51fd\u6570\u548c\u8fde\u63a5\u8868\u8fbe\u5f0f\u6765\u4e86\u89e3\u6709\u5173\u4f7f\u7528SQL\u51fd\u6570\u8fde\u63a5\u591a\u4e2a\u503c\u7684\u66f4\u591a\u4fe1\u606f\u3002\u60a8\u8fd8\u53ef\u4ee5\u53c2\u8003MySQL\u6587\u6863\u4e2d\u7684<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/string-functions.html\">\u5b57\u7b26\u4e32\u51fd\u6570\u548c\u8fd0\u7b97\u7b26<\/a>\u3002<\/p>\n<p>\u5728\u4e0b\u4e00\u8282\u4e2d\uff0c\u60a8\u5c06\u4f7f\u7528SQL\u51fd\u6570\u6765\u64cd\u4f5c\u6570\u636e\u5e93\u4e2d\u7684\u65e5\u671f\u3002<\/p>\n<h2>\u4f7f\u7528\u65e5\u671f\u548c\u65f6\u95f4\u51fd\u6570<\/h2>\n<p>SQL\u4e2d\u7684\u65e5\u671f\u548c\u65f6\u95f4\u51fd\u6570\u53ef\u4ee5\u5728\u5904\u7406SQL\u67e5\u8be2\u65f6\u64cd\u4f5c\u5b58\u50a8\u5728\u65e5\u671f\u548c\u65f6\u95f4\u6233\u5217\u4e2d\u7684\u503c\u3002\u5b83\u4eec\u53ef\u7528\u4e8e\u63d0\u53d6\u65e5\u671f\u4fe1\u606f\u7684\u90e8\u5206\uff0c\u6267\u884c\u65e5\u671f\u8fd0\u7b97\uff0c\u6216\u5c06\u65e5\u671f\u548c\u65f6\u95f4\u6233\u683c\u5f0f\u5316\u4e3a\u6240\u9700\u7684\u8f93\u51fa\u683c\u5f0f\u3002<\/p>\n<p>\u5047\u8bbe\u60a8\u9700\u8981\u5c06\u4e66\u7c4d\u7684\u4ecb\u7ecd\u65e5\u671f\u5355\u72ec\u5206\u4e3a\u5e74\u3001\u6708\u548c\u65e5\uff0c\u800c\u4e0d\u662f\u5728\u8f93\u51fa\u4e2d\u53ea\u6709\u4e00\u4e2a\u65e5\u671f\u5217\u3002<\/p>\n<p>\u8bf7\u5c1d\u8bd5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4:<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT introduction_date, <mark>YEAR<span class=\"token punctuation\">(<\/span>introduction_date<span class=\"token punctuation\">)<\/span> as year<\/mark>, <mark>MONTH<span class=\"token punctuation\">(<\/span>introduction_date<span class=\"token punctuation\">)<\/span> as month<\/mark>, <mark>DAY<span class=\"token punctuation\">(<\/span>introduction_date<span class=\"token punctuation\">)<\/span> as day<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u60a8\u5c06\u4f1a\u6536\u5230\u8fd9\u4e2a\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>+-------------------+------+-------+------+\r\n| introduction_date | year | month | day  |\r\n+-------------------+------+-------+------+\r\n| 2022-10-01        | 2022 | 10    | 1    |\r\n| 2022-10-04        | 2022 | 10    | 4    |\r\n| 2022-09-23        | 2022 | 9     | 23   |\r\n| 2022-07-23        | 2022 | 7     | 23   |\r\n| 2022-10-01        | 2022 | 10    | 1    |\r\n+-------------------+------+-------+------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8fd9\u4e2aSQL\u8bed\u53e5\u4f7f\u7528\u4e86\u4e09\u4e2a\u72ec\u7acb\u7684\u51fd\u6570\uff1a<code>YEAR<\/code>\u3001<code>MONTH<\/code>\u548c<code>DAY<\/code>\u3002\u6bcf\u4e2a\u51fd\u6570\u5c06\u5b58\u50a8\u65e5\u671f\u7684\u5217\u540d\u4f5c\u4e3a\u53c2\u6570\uff0c\u5e76\u5206\u522b\u63d0\u53d6\u5b8c\u6574\u65e5\u671f\u7684\u67d0\u4e2a\u90e8\u5206\uff1a\u5e74\u4efd\u3001\u6708\u4efd\u6216\u65e5\u671f\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u51fd\u6570\uff0c\u60a8\u53ef\u4ee5\u5728SQL\u67e5\u8be2\u4e2d\u8bbf\u95ee\u5355\u72ec\u7684\u65e5\u671f\u7247\u6bb5\u3002<\/p>\n<p>\u53e6\u4e00\u4e2a\u6709\u7528\u7684\u65e5\u671f\u5904\u7406\u51fd\u6570\u662f<code>DATEDIFF<\/code>\uff0c\u5b83\u5141\u8bb8\u60a8\u83b7\u53d6\u4e24\u4e2a\u65e5\u671f\u4e4b\u95f4\u7684\u5929\u6570\u3002\u73b0\u5728\uff0c\u8bf7\u5c1d\u8bd5\u68c0\u67e5\u6bcf\u672c\u4e66\u7684\u4ecb\u7ecd\u65e5\u671f\u4e0e\u5f53\u524d\u65e5\u671f\u4e4b\u95f4\u5df2\u7ecf\u8fc7\u53bb\u4e86\u591a\u5c11\u5929\u3002<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT introduction_date, <mark>DATEDIFF<span class=\"token punctuation\">(<\/span>introduction_date, CURRENT_DATE<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">))<\/span> AS days_since<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u8f93\u51fa\u5c06\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<pre class=\"post-pre\"><code>+-------------------+------------+\r\n| introduction_date | days_since |\r\n+-------------------+------------+\r\n| 2022-10-01        | -30        |\r\n| 2022-10-04        | -27        |\r\n| 2022-09-23        | -38        |\r\n| 2022-07-23        | -100       |\r\n| 2022-10-01        | -30        |\r\n+-------------------+------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p><code>DATEDIFF<\/code>\u51fd\u6570\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\uff1a\u8d77\u59cb\u65e5\u671f\u548c\u7ed3\u675f\u65e5\u671f\u3002<code>DATEDIFF<\/code>\u51fd\u6570\u8ba1\u7b97\u8fd9\u4e24\u4e2a\u65f6\u95f4\u70b9\u4e4b\u95f4\u7684\u5929\u6570\u5dee\u3002\u5982\u679c\u7ed3\u675f\u65e5\u671f\u8f83\u65e9\uff0c\u5219\u7ed3\u679c\u53ef\u80fd\u4e3a\u8d1f\u6570\u3002\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u5b58\u50a8\u5e93\u5b58\u8868\u4e2d\u65e5\u671f\u7684<code>introduction_date<\/code>\u5217\u540d\u3002\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u53e6\u4e00\u4e2a\u51fd\u6570<code>CURRENT_DATE<\/code>\uff0c\u8868\u793a\u5f53\u524d\u7cfb\u7edf\u65e5\u671f\u3002\u6267\u884c\u6b64\u67e5\u8be2\u5c06\u68c0\u7d22\u51fa\u4e24\u4e2a\u65f6\u95f4\u70b9\u4e4b\u95f4\u7684\u5929\u6570\uff0c\u5e76\u5c06\u7ed3\u679c\u653e\u5165<code>days_since<\/code>\u4e34\u65f6\u5217\u4e2d\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">\u6ce8\u610f\uff1a<code>DATEDIFF<\/code>\u4e0d\u662f\u5b98\u65b9SQL\u6807\u51c6\u51fd\u6570\u96c6\u7684\u4e00\u90e8\u5206\u3002\u5c3d\u7ba1\u8bb8\u591a\u6570\u636e\u5e93\u652f\u6301\u6b64\u51fd\u6570\uff0c\u4f46\u5176\u8bed\u6cd5\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u5f15\u64ce\u4e4b\u95f4\u5e38\u5e38\u5b58\u5728\u5dee\u5f02\u3002\u6b64\u793a\u4f8b\u91c7\u7528\u4e86\u7b26\u5408MySQL\u672c\u5730\u8bed\u6cd5\u7684\u5199\u6cd5\u3002MySQL\u4e2d\u8fd8\u6709\u5176\u4ed6\u7684\u65e5\u671f\u64cd\u4f5c\u51fd\u6570\uff0c\u5305\u62ec\u6dfb\u52a0\u548c\u51cf\u53bb\u65e5\u671f\u548c\u65f6\u95f4\u95f4\u9694\uff0c\u4e3a\u4e0d\u540c\u8bed\u8a00\u683c\u5f0f\u5316\u65e5\u671f\uff0c\u83b7\u53d6\u65e5\u671f\u548c\u6708\u4efd\u7684\u540d\u79f0\uff0c\u6216\u8005\u521b\u5efa\u65b0\u7684\u65e5\u671f\u503c\u3002\u60a8\u53ef\u4ee5\u5728<a href=\"https:\/\/www.example.com\/sql-date-time-tutorial\">\u300a\u5982\u4f55\u5728SQL\u4e2d\u5904\u7406\u65e5\u671f\u548c\u65f6\u95f4\u300b<\/a>\u6559\u7a0b\u4e2d\u4e86\u89e3\u66f4\u591a\u6709\u5173\u5728SQL\u4e2d\u5904\u7406\u65e5\u671f\u7684\u4fe1\u606f\u3002\u60a8\u8fd8\u53ef\u4ee5\u53c2\u8003MySQL\u6587\u6863\u4e2d\u7684<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/date-and-time-functions.html\">\u65e5\u671f\u548c\u65f6\u95f4\u51fd\u6570<\/a>\u90e8\u5206\u3002<\/p>\n<\/div>\n<p>\u5728\u63a5\u4e0b\u6765\u7684\u90e8\u5206\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u4f7f\u7528\u805a\u5408\u51fd\u6570\u3002<\/p>\n<h2>\u4f7f\u7528\u805a\u5408\u51fd\u6570<\/h2>\n<p>\u5728\u6240\u6709\u4e4b\u524d\u7684\u4f8b\u5b50\u4e2d\uff0c\u4f60\u4f7f\u7528\u4e86SQL\u51fd\u6570\u6765\u5bf9\u5355\u884c\u4e2d\u7684\u6bcf\u4e2a\u5217\u503c\u5e94\u7528\u8f6c\u6362\u6216\u8ba1\u7b97\uff0c\u8be5\u884c\u4ee3\u8868\u4e66\u5e97\u4e2d\u7684\u4e00\u672c\u4e66\u3002SQL\u63d0\u4f9b\u4e86\u4e00\u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u591a\u884c\u4e4b\u95f4\u6267\u884c\u6570\u5b66\u8ba1\u7b97\uff0c\u4ee5\u5e2e\u52a9\u4f60\u627e\u5230\u5173\u4e8e\u6574\u4e2a\u6570\u636e\u96c6\u7684\u805a\u5408\u4fe1\u606f\u3002<\/p>\n<p>SQL\u4e2d\u7684\u4e3b\u8981\u805a\u5408\u51fd\u6570\u5305\u62ec\u4ee5\u4e0b\u51e0\u79cd\uff1a<\/p>\n<ul class=\"post-ul\">\n<li><code>AVG<\/code>\uff1a\u8ba1\u7b97\u503c\u7684\u5e73\u5747\u503c\u3002<\/li>\n<li><code>COUNT<\/code>\uff1a\u8ba1\u7b97\u503c\u7684\u6570\u91cf\u3002<\/li>\n<li><code>MAX<\/code>\uff1a\u83b7\u53d6\u6700\u5927\u503c\u3002<\/li>\n<li><code>MIN<\/code>\uff1a\u83b7\u53d6\u6700\u5c0f\u503c\u3002<\/li>\n<li><code>SUM<\/code>\uff1a\u8ba1\u7b97\u6240\u6709\u503c\u7684\u603b\u548c\u3002<\/li>\n<\/ul>\n<p>\u4f60\u53ef\u4ee5\u5728\u4f60\u7684<code>SELECT<\/code>\u67e5\u8be2\u4e2d\u7ed3\u5408\u591a\u4e2a\u805a\u5408\u51fd\u6570\u3002\u60f3\u8c61\u4e00\u4e0b\uff0c\u4f60\u60f3\u8981\u67e5\u770b\u4e66\u5e97\u4e2d\u5217\u51fa\u7684\u4e66\u7c4d\u6570\u91cf\u3001\u4efb\u4f55\u4e00\u672c\u4e66\u7684\u6700\u9ad8\u4ef7\u683c\u4ee5\u53ca\u6574\u4e2a\u76ee\u5f55\u4e2d\u7684\u5e73\u5747\u4ef7\u683c\u3002\u8981\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u6267\u884c\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT <mark>COUNT<span class=\"token punctuation\">(<\/span>title<span class=\"token punctuation\">)<\/span> AS count<\/mark>, <mark>MAX<span class=\"token punctuation\">(<\/span>price<span class=\"token punctuation\">)<\/span> AS max_price<\/mark>, <mark>AVG<span class=\"token punctuation\">(<\/span>price<span class=\"token punctuation\">)<\/span> AS avg_price<\/mark> FROM inventory<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8fd9\u4e2a\u8bed\u53e5\u8fd4\u56de\u4ee5\u4e0b\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/div>\n<p>\u8fd9\u662f\u6587\u7ae0\u300a\u5982\u4f55\u5728SQL\u4e2d\u4f7f\u7528\u51fd\u6570\u300b\u7684\u7b2c6\u90e8\u5206\uff08\u51716\u90e8\u5206\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code>+-------+-----------+-----------+\r\n| count | max_price | avg_price |\r\n+-------+-----------+-----------+\r\n|     5 |     42.13 | 25.106000 |\r\n+-------+-----------+-----------+\r\n1 row in set (0.001 sec)<\/code><\/pre>\n<p>\u4ee5\u4e0a\u67e5\u8be2\u540c\u65f6\u4f7f\u7528\u4e86\u4e09\u4e2a\u805a\u5408\u51fd\u6570\u3002<code>COUNT<\/code>\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u67e5\u8be2\u6240\u67e5\u627e\u7684\u884c\u6570\u3002\u5728\u672c\u4f8b\u4e2d\uff0c<code>title<\/code>\u88ab\u4f20\u9012\u4e3a\u53c2\u6570\uff0c\u4f46\u7531\u4e8e\u6bcf\u4e2a\u5217\u7684\u884c\u6570\u662f\u76f8\u540c\u7684\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u5176\u4ed6\u5217\u540d\u4f5c\u4e3a\u8be5\u51fd\u6570\u7684\u53c2\u6570\u3002<code>MAX<\/code>\u51fd\u6570\u8ba1\u7b97\u4e86<code>price<\/code>\u5217\u4e2d\u7684\u6700\u5927\u503c\uff1a\u5728\u8fd9\u91cc\uff0c\u5217\u540d\u5f88\u91cd\u8981\uff0c\u56e0\u4e3a\u8ba1\u7b97\u662f\u5728\u8be5\u5217\u7684\u503c\u4e0a\u8fdb\u884c\u7684\u3002\u6700\u540e\u4e00\u4e2a\u51fd\u6570\u662f<code>AVG<\/code>\u51fd\u6570\uff0c\u5b83\u8ba1\u7b97\u4e86<code>price<\/code>\u5217\u4e2d\u6240\u6709\u4ef7\u683c\u7684\u5e73\u5747\u503c\u3002<\/p>\n<p>\u4ee5\u8fd9\u79cd\u65b9\u5f0f\u4f7f\u7528\u805a\u5408\u51fd\u6570\u4f1a\u5bfc\u81f4\u6570\u636e\u5e93\u8fd4\u56de\u4e00\u884c\u4e34\u65f6\u5217\uff0c\u8868\u793a\u805a\u5408\u8ba1\u7b97\u7684\u7ed3\u679c\u503c\u3002\u6e90\u884c\u5728\u5185\u90e8\u7528\u4e8e\u8ba1\u7b97\uff0c\u4f46\u4e0d\u901a\u8fc7\u67e5\u8be2\u8fd4\u56de\u3002\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u60a8\u4f7f\u7528\u805a\u5408\u51fd\u6570\u4e00\u6b21\u4ece\u6574\u4e2a\u5e93\u5b58\u8868\u8ba1\u7b97\u7edf\u8ba1\u503c\uff0c\u8003\u8651\u4e86\u6240\u6709\u884c\u7684\u6458\u8981\u4fe1\u606f\u3002<\/p>\n<p>\u4f7f\u7528SQL\uff0c\u8fd8\u53ef\u4ee5\u5c06\u8868\u4e2d\u7684\u884c\u5206\u6210\u4e0d\u540c\u7684\u7ec4\uff0c\u7136\u540e\u5206\u522b\u8ba1\u7b97\u8fd9\u4e9b\u7ec4\u7684\u5408\u8ba1\u503c\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u8ba1\u7b97\u4e0d\u540c\u4f5c\u8005\u7684\u56fe\u4e66\u5e73\u5747\u4ef7\u683c\uff0c\u4ee5\u4e86\u89e3\u54ea\u4e2a\u4f5c\u8005\u51fa\u7248\u7684\u4e66\u6700\u8d35\u3002\u4f60\u53ef\u4ee5\u5728SQL\u6559\u7a0b\u4e2d\u7684\u300a<a href=\"#\">\u5982\u4f55\u4f7f\u7528GROUP BY\u548cORDER BY<\/a>\u300b\u4e2d\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u5206\u7ec4\u884c\u8fdb\u884c\u8ba1\u7b97\u7684\u5185\u5bb9\u3002\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7\u300a<a href=\"#\">\u5982\u4f55\u4f7f\u7528\u6570\u5b66\u8868\u8fbe\u5f0f\u548c\u805a\u5408\u51fd\u6570\u7684SQL\u6559\u7a0b<\/a>\u300b\u6df1\u5165\u4e86\u89e3\u4f7f\u7528\u805a\u5408\u65b9\u5f0f\u7684\u66f4\u591a\u7ec6\u8282\u3002<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u901a\u8fc7\u9075\u5faa\u672c\u6307\u5357\uff0c\u60a8\u5b66\u4f1a\u4e86\u4ec0\u4e48\u662fSQL\u51fd\u6570\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u4eec\u6765\u64cd\u4f5c\u6570\u503c\u3001\u5b57\u7b26\u4e32\u548c\u65e5\u671f\u3002\u60a8\u4f7f\u7528\u4e86<code>ROUND<\/code>\u51fd\u6570\u6765\u5c06\u6570\u5b57\u503c\u56db\u820d\u4e94\u5165\uff0c\u4f7f\u7528<code>CONCAT<\/code>\u51fd\u6570\u5c06\u591a\u4e2a\u5217\u8fde\u63a5\u6210\u4e00\u4e2a\uff0c\u4f7f\u7528<code>DATEDIFF<\/code>\u51fd\u6570\u8ba1\u7b97\u4e24\u4e2a\u65f6\u95f4\u70b9\u4e4b\u95f4\u7684\u5929\u6570\u3002\u6700\u540e\uff0c\u60a8\u8fd8\u4f7f\u7528\u4e86\u5982<code>COUNT<\/code>\u3001<code>SUM<\/code>\u6216<code>AVG<\/code>\u7b49\u805a\u5408\u51fd\u6570\u6765\u751f\u6210\u8de8\u591a\u884c\u7684\u6458\u8981\u4fe1\u606f\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u5c06\u4e00\u4e9b\u6570\u636e\u64cd\u4f5c\u548c\u8ba1\u7b97\u4efb\u52a1\u8f6c\u79fb\u5230\u6570\u636e\u5e93\u5f15\u64ce\u4e2d\uff0c\u4ece\u800c\u5229\u7528\u51fd\u6570\u3002\u672c\u6559\u7a0b\u4ec5\u6db5\u76d6\u4e86\u4f7f\u7528\u51fd\u6570\u8fdb\u884c\u8fd9\u4e9b\u64cd\u4f5c\u7684\u57fa\u7840\u77e5\u8bc6\u3002\u4e3a\u4e86\u4ee5\u5f3a\u5927\u7684\u65b9\u5f0f\u68c0\u7d22\u548c\u5206\u6790\u6570\u636e\uff0c\u60a8\u53ef\u4ee5\u5c06\u51fd\u6570\u4e0e\u4f7f\u7528<code>WHERE<\/code>\u5b50\u53e5\u8fdb\u884c\u6761\u4ef6\u67e5\u8be2\u4ee5\u53ca\u4f7f\u7528<code>GROUP BY<\/code>\u548c<code>ORDER BY<\/code>\u8fdb\u884c\u5206\u7ec4\u7684\u65b9\u6cd5\u76f8\u7ed3\u5408\u3002<\/p>\n<p>\u867d\u7136\u8fd9\u91cc\u5c55\u793a\u7684\u547d\u4ee4\u5728\u5927\u591a\u6570\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e0a\u90fd\u53ef\u4ee5\u4f7f\u7528\uff0c\u4f46\u8bf7\u6ce8\u610f\u6bcf\u4e2aSQL\u6570\u636e\u5e93\u90fd\u6709\u81ea\u5df1\u7684\u8bed\u8a00\u5b9e\u73b0\u3002\u60a8\u5e94\u8be5\u53c2\u8003\u60a8\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u5b98\u65b9\u6587\u6863\uff0c\u4ee5\u83b7\u53d6\u6bcf\u4e2a\u547d\u4ee4\u7684\u5b8c\u6574\u63cf\u8ff0\u548c\u5168\u90e8\u9009\u9879\u3002<\/p>\n<p>\u5982\u679c\u60a8\u60f3\u66f4\u591a\u4e86\u89e3SQL\u8bed\u8a00\u7684\u4e0d\u540c\u6982\u5ff5\u4ee5\u53ca\u5904\u7406\u65b9\u6cd5\uff0c\u6211\u4eec\u9f13\u52b1\u60a8\u67e5\u770b\u201c\u5982\u4f55\u4f7f\u7528SQL\u201d\u7cfb\u5217\u4e2d\u7684\u5176\u4ed6\u6307\u5357\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u8a00 \u5f53\u4f7f\u7528\u5173\u7cfb\u578b\u6570\u636e\u5e93\u548c\u7ed3\u6784\u5316\u67e5\u8be2\u8bed\u8a00\uff08SQL\uff09\u65f6\uff0c\u60a8\u53ef\u4ee5\u4ece\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08RDBMS\uff09\u4e2d\u5b58\u50a8\u3001\u7ba1\u7406\u548c [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[489,487,488,391,257],"class_list":{"0":"post-92","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-uncategorized","7":"tag-sql","10":"tag-391","11":"tag-257"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u672c\u6587\u5168\u9762\u89e3\u6790SQL\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6db5\u76d6\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\uff0c\u52a9\u60a8\u9ad8\u6548\u5904\u7406\u6570\u636e\u3001\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u4ece\u5165\u95e8\u5230\u7cbe\u901a\uff0c\u638c\u63e1SQL\u51fd\u6570\u7684\u6838\u5fc3\u6280\u5de7\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728sql\u4e2d\u4f7f\u7528\u51fd\u6570\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u5168\u9762\u89e3\u6790SQL\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6db5\u76d6\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\uff0c\u52a9\u60a8\u9ad8\u6548\u5904\u7406\u6570\u636e\u3001\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u4ece\u5165\u95e8\u5230\u7cbe\u901a\uff0c\u638c\u63e1SQL\u51fd\u6570\u7684\u6838\u5fc3\u6280\u5de7\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728sql\u4e2d\u4f7f\u7528\u51fd\u6570\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-30T06:53:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T14:45:52+00:00\" \/>\n<meta name=\"author\" content=\"\u6e05, \u5b87\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u5b87\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/\",\"name\":\"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-05-30T06:53:10+00:00\",\"dateModified\":\"2025-07-31T14:45:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e\"},\"description\":\"\u672c\u6587\u5168\u9762\u89e3\u6790SQL\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6db5\u76d6\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\uff0c\u52a9\u60a8\u9ad8\u6548\u5904\u7406\u6570\u636e\u3001\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u4ece\u5165\u95e8\u5230\u7cbe\u901a\uff0c\u638c\u63e1SQL\u51fd\u6570\u7684\u6838\u5fc3\u6280\u5de7\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e\",\"name\":\"\u6e05, \u5b87\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u5b87\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - Blog - Silicon Cloud","description":"\u672c\u6587\u5168\u9762\u89e3\u6790SQL\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6db5\u76d6\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\uff0c\u52a9\u60a8\u9ad8\u6548\u5904\u7406\u6570\u636e\u3001\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u4ece\u5165\u95e8\u5230\u7cbe\u901a\uff0c\u638c\u63e1SQL\u51fd\u6570\u7684\u6838\u5fc3\u6280\u5de7\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728sql\u4e2d\u4f7f\u7528\u51fd\u6570\/","og_locale":"zh_CN","og_type":"article","og_title":"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528","og_description":"\u672c\u6587\u5168\u9762\u89e3\u6790SQL\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6db5\u76d6\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\uff0c\u52a9\u60a8\u9ad8\u6548\u5904\u7406\u6570\u636e\u3001\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u4ece\u5165\u95e8\u5230\u7cbe\u901a\uff0c\u638c\u63e1SQL\u51fd\u6570\u7684\u6838\u5fc3\u6280\u5de7\u3002","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728sql\u4e2d\u4f7f\u7528\u51fd\u6570\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-05-30T06:53:10+00:00","article_modified_time":"2025-07-31T14:45:52+00:00","author":"\u6e05, \u5b87","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u5b87","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/","name":"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-05-30T06:53:10+00:00","dateModified":"2025-07-31T14:45:52+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e"},"description":"\u672c\u6587\u5168\u9762\u89e3\u6790SQL\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6db5\u76d6\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u3001\u805a\u5408\u7b49\u591a\u79cd\u7c7b\u578b\uff0c\u52a9\u60a8\u9ad8\u6548\u5904\u7406\u6570\u636e\u3001\u4f18\u5316\u67e5\u8be2\u6027\u80fd\u3002\u4ece\u5165\u95e8\u5230\u7cbe\u901a\uff0c\u638c\u63e1SQL\u51fd\u6570\u7684\u6838\u5fc3\u6280\u5de7\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL\u51fd\u6570\u6df1\u5ea6\u89e3\u6790\uff1a\u4ece\u57fa\u7840\u5230\u9ad8\u7ea7\u5e94\u7528"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/1a6ecd3d914d22a5ac32791ffc1fbd8e","name":"\u6e05, \u5b87","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b2016c18459a605fc469c7566608f5686491baa112d0871ee613f61b7210565?s=96&d=mm&r=g","caption":"\u6e05, \u5b87"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8sql%e4%b8%ad%e4%bd%bf%e7%94%a8%e5%87%bd%e6%95%b0\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":4,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":109559,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions\/109559"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}