{"id":103,"date":"2021-07-07T09:30:39","date_gmt":"2021-07-07T01:30:39","guid":{"rendered":"http:\/\/daishen.ltd\/?p=103"},"modified":"2021-07-07T09:30:39","modified_gmt":"2021-07-07T01:30:39","slug":"sql%e6%b3%a8%e5%85%a5%e5%bf%85%e5%a4%87%e7%9f%a5%e8%af%86%e5%88%9d%e7%ba%a7","status":"publish","type":"post","link":"https:\/\/daishen.ltd\/?p=103","title":{"rendered":"SQL\u6ce8\u5165\u5fc5\u5907\u77e5\u8bc6\u521d\u7ea7"},"content":{"rendered":"<p><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width initial-scale=1\"><br \/>\n<title>SQL\u6ce8\u5165\u5fc5\u5907\u77e5\u8bc6\u521d\u7ea7<\/title><\/p>\n<h1 id=\"sql\u6ce8\u5165\u5fc5\u5907\u77e5\u8bc6\u521d\u7ea7\">SQL\u6ce8\u5165\u5fc5\u5907\u77e5\u8bc6\u521d\u7ea7<\/h1>\n<ul>\n<li>\n<h3 id=\"\u9996\u5148sql\u8bed\u53e5\u5bf9\u5927\u5c0f\u5199\u4e0d\u654f\u611f\u8fd9\u4e5f\u5bfc\u81f4\u4e86\u540e\u53f0\u7a0b\u5e8f\u5bf9\u5927\u5c0f\u5199\u7684\u68c0\u6d4b\u5931\u6548\">\u9996\u5148SQL\u8bed\u53e5\u5bf9\u5927\u5c0f\u5199\u4e0d\u654f\u611f\uff0c\u8fd9\u4e5f\u5bfc\u81f4\u4e86\u540e\u53f0\u7a0b\u5e8f\u5bf9\u5927\u5c0f\u5199\u7684\u68c0\u6d4b\u5931\u6548\u3002<\/h3>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<h3 id=\"sql-\u6ce8\u91ca\u8bed\u53e5---\u4e0e\">SQL \u6ce8\u91ca\u8bed\u53e5 (&#8220;&#8211;&#8220;\u4e0e&#8221;\/<em>&#8230;<\/em>\/&#8221;)<\/h3>\n<\/li>\n<\/ul>\n<pre><code>\uff081\uff09--\uff1a\u8868\u793a\u5355\u884c\u6ce8\u91ca\n\n\uff082\uff09\/*\u2026*\/\uff1a\u7528\u4e8e\u591a\u884c\uff08\u5757\uff09\u6ce8\u91ca\n<\/code><\/pre>\n<ul>\n<li>\n<h3 id=\"select-\u67e5\u8be2\u8bed\u53e5\">SELECT \u67e5\u8be2\u8bed\u53e5<\/h3>\n<\/li>\n<\/ul>\n<p>SQL SELECT \u8bed\u6cd5<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT \u5217\u540d\u79f0 FROM \u8868\u540d\u79f0\nSELECT * FROM \u8868\u540d\u79f0\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>\n<h3 id=\"union-\u64cd\u4f5c\u7b26\">UNION \u64cd\u4f5c\u7b26<\/h3>\n<\/li>\n<\/ul>\n<p>UNION \u64cd\u4f5c\u7b26\u7528\u4e8e\u5408\u5e76\u4e24\u4e2a\u6216\u591a\u4e2a SELECT \u8bed\u53e5\u7684\u7ed3\u679c\u96c6\u3002<\/p>\n<p>\u8bf7\u6ce8\u610f\uff0cUNION \u5185\u90e8\u7684 SELECT \u8bed\u53e5\u5fc5\u987b\u62e5\u6709\u76f8\u540c\u6570\u91cf\u7684\u5217\u3002\u5217\u4e5f\u5fc5\u987b\u62e5\u6709\u76f8\u4f3c\u7684\u6570\u636e\u7c7b\u578b\u3002\u540c\u65f6\uff0c\u6bcf\u6761 SELECT \u8bed\u53e5\u4e2d\u7684\u5217\u7684\u987a\u5e8f\u5fc5\u987b\u76f8\u540c\u3002<\/p>\n<p>SQL UNION \u8bed\u6cd5<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT column_name(s) FROM table_name1\nUNION\nSELECT column_name(s) FROM table_name2\n<\/code><\/pre>\n<\/blockquote>\n<p>\u6ce8\u91ca\uff1a\u9ed8\u8ba4\u5730\uff0cUNION \u64cd\u4f5c\u7b26\u9009\u53d6\u4e0d\u540c\u7684\u503c\u3002\u5982\u679c\u5141\u8bb8\u91cd\u590d\u7684\u503c\uff0c\u8bf7\u4f7f\u7528 UNION ALL\u3002<\/p>\n<ul>\n<li>\n<h3 id=\"concat\">concat()<\/h3>\n<\/li>\n<\/ul>\n<p>CONCAT \u51fd\u6570\u7528\u4e8e\u5c06\u4e24\u4e2a\u5b57\u7b26\u4e32\u8fde\u63a5\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32<\/p>\n<p>1\u3001\u8bed\u6cd5\u53ca\u4f7f\u7528\u7279\u70b9\uff1a<\/p>\n<pre><code>CONCAT(str1,str2,\u2026) \n<\/code><\/pre>\n<p>\u8fd4\u56de\u7ed3\u679c\u4e3a\u8fde\u63a5\u53c2\u6570\u4ea7\u751f\u7684\u5b57\u7b26\u4e32\u3002\u5982\u6709\u4efb\u4f55\u4e00\u4e2a\u53c2\u6570\u4e3aNULL \uff0c\u5219\u8fd4\u56de\u503c\u4e3a NULL\u3002\u53ef\u4ee5\u6709\u4e00\u4e2a\u6216\u591a\u4e2a\u53c2\u6570\u3002<\/p>\n<p>2\u3001\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<pre><code>SELECT CONCAT(id, \u2018\uff0c\u2019, name) AS con FROM info LIMIT 1;\n<\/code><\/pre>\n<ul>\n<li>\n<h3 id=\"concatws\">concat_ws()<\/h3>\n<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u51fd\u6570CONCAT_WS\uff08\uff09\u3002<\/p>\n<p>\u4f7f\u7528\u8bed\u6cd5\u4e3a\uff1a<\/p>\n<pre><code>CONCAT_WS(separator,str1,str2,\u2026)\n<\/code><\/pre>\n<p>CONCAT_WS() \u4ee3\u8868 CONCAT With Separator \uff0c\u662fCONCAT()\u7684\u7279\u6b8a\u5f62\u5f0f\u3002\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u5176\u5b83\u53c2\u6570\u7684\u5206\u9694\u7b26\u3002\u5206\u9694\u7b26\u7684\u4f4d\u7f6e\u653e\u5728\u8981\u8fde\u63a5\u7684\u4e24\u4e2a\u5b57\u7b26\u4e32\u4e4b\u95f4\u3002\u5206\u9694\u7b26\u53ef\u4ee5\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u4e5f\u53ef\u4ee5\u662f\u5176\u5b83\u53c2\u6570\u3002\u5982\u679c\u5206\u9694\u7b26\u4e3a NULL\uff0c\u5219\u7ed3\u679c\u4e3a NULL\u3002\u51fd\u6570\u4f1a\u5ffd\u7565\u4efb\u4f55\u5206\u9694\u7b26\u53c2\u6570\u540e\u7684 NULL \u503c\u3002\u4f46\u662fCONCAT_WS()\u4e0d\u4f1a\u5ffd\u7565\u4efb\u4f55\u7a7a\u5b57\u7b26\u4e32\u3002 (\u7136\u800c\u4f1a\u5ffd\u7565\u6240\u6709\u7684 NULL\uff09\u3002<\/p>\n<p>\u5982<\/p>\n<pre><code>SELECT CONCAT_WS('_',id,name) AS con_ws FROM info LIMIT 1;\n<\/code><\/pre>\n<ul>\n<li>\n<h3 id=\"groupconcat\">group_concat()<\/h3>\n<\/li>\n<\/ul>\n<p>GROUP_CONCAT\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\u7ed3\u679c\uff0c\u8be5\u7ed3\u679c\u7531\u5206\u7ec4\u4e2d\u7684\u503c\u8fde\u63a5\u7ec4\u5408\u800c\u6210\u3002<br \/>\n\u4f7f\u7528\u8868info\u4f5c\u4e3a\u793a\u4f8b\uff0c\u5176\u4e2d\u8bed\u53e5SELECT locus,id,journal FROM info WHERE locus IN(&#8216;AB086827&#8242;,&#8217;AF040764&#8217;);\u7684\u8fd4\u56de\u7ed3\u679c\u4e3a<\/p>\n<pre><code>+----------+----+--------------------------+\n| locus    | id | journal                  |\n+----------+----+--------------------------+\n| AB086827 |  1 | Unpublished              |\n| AB086827 |  2 | Submitted (20-JUN-2002)  |\n| AF040764 | 23 | Unpublished              |\n| AF040764 | 24 | Submitted (31-DEC-1997)  |\n+----------+----+--------------------------+\n<\/code><\/pre>\n<p>1\u3001\u4f7f\u7528\u8bed\u6cd5\u53ca\u7279\u70b9\uff1a<\/p>\n<pre><code>GROUP_CONCAT([DISTINCT] expr [,expr ...]\n[ORDER BY {unsigned_integer | col_name | formula} [ASC | DESC] [,col ...]]\n[SEPARATOR str_val])\n<\/code><\/pre>\n<p>\u5728 MySQL \u4e2d\uff0c\u4f60\u53ef\u4ee5\u5f97\u5230\u8868\u8fbe\u5f0f\u7ed3\u5408\u4f53\u7684\u8fde\u7ed3\u503c\u3002\u901a\u8fc7\u4f7f\u7528 DISTINCT \u53ef\u4ee5\u6392\u9664\u91cd\u590d\u503c\u3002\u5982\u679c\u5e0c\u671b\u5bf9\u7ed3\u679c\u4e2d\u7684\u503c\u8fdb\u884c\u6392\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528 ORDER BY \u5b50\u53e5\u3002<br \/>\nSEPARATOR \u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u503c\uff0c\u5b83\u88ab\u7528\u4e8e\u63d2\u5165\u5230\u7ed3\u679c\u503c\u4e2d\u3002\u7f3a\u7701\u4e3a\u4e00\u4e2a\u9017\u53f7 (&#8220;,&#8221;)\uff0c\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a SEPARATOR &#8220;&#8221; \u5b8c\u5168\u5730\u79fb\u9664\u8fd9\u4e2a\u5206\u9694\u7b26\u3002<br \/>\n\u53ef\u4ee5\u901a\u8fc7\u53d8\u91cf group_concat_max_len \u8bbe\u7f6e\u4e00\u4e2a\u6700\u5927\u7684\u957f\u5ea6\u3002\u5728\u8fd0\u884c\u65f6\u6267\u884c\u7684\u53e5\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code> SET [SESSION | GLOBAL] group_concat_max_len = unsigned_integer;\n<\/code><\/pre>\n<p>\u5982\u679c\u6700\u5927\u957f\u5ea6\u88ab\u8bbe\u7f6e\uff0c\u7ed3\u679c\u503c\u88ab\u526a\u5207\u5230\u8fd9\u4e2a\u6700\u5927\u957f\u5ea6\u3002\u5982\u679c\u5206\u7ec4\u7684\u5b57\u7b26\u8fc7\u957f\uff0c\u53ef\u4ee5\u5bf9\u7cfb\u7edf\u53c2\u6570\u8fdb\u884c\u8bbe\u7f6e\uff1aSET @@global.group_concat_max_len=40000;<\/p>\n<p>2\u3001\u4f7f\u7528\u793a\u4f8b\uff1a<br \/>\n\u8bed\u53e5<\/p>\n<pre><code>SELECT locus,GROUP_CONCAT(id) FROM info WHERE locus IN('AB086827','AF040764') GROUP BY locus;\n<\/code><\/pre>\n<p>\u7684\u8fd4\u56de\u7ed3\u679c\u4e3a<\/p>\n<pre><code>+----------+------------------+\n| locus    | GROUP_CONCAT(id) |\n+----------+------------------+\n| AB086827 | 1,2              |\n| AF040764 | 23,24            |\n+----------+------------------+\n<\/code><\/pre>\n<p>\u8bed\u53e5<\/p>\n<pre><code> SELECT locus,GROUP_CONCAT(distinct id ORDER BY id DESC SEPARATOR '_') FROM info WHERE locus IN('AB086827','AF040764') GROUP BY locus;\n<\/code><\/pre>\n<p>\u7684\u8fd4\u56de\u7ed3\u679c\u4e3a<\/p>\n<pre><code>+----------+----------------------------------------------------------+\n| locus    | GROUP_CONCAT(distinct id ORDER BY id DESC SEPARATOR '_') |\n+----------+----------------------------------------------------------+\n| AB086827 | 2_1                                                      |\n| AF040764 | 24_23                                                    |\n+----------+----------------------------------------------------------+\n<\/code><\/pre>\n<ul>\n<li>\n<h3 id=\"order-by\">order by<\/h3>\n<\/li>\n<\/ul>\n<p>ORDER BY \u8bed\u53e5\u7528\u4e8e\u6839\u636e\u6307\u5b9a\u7684\u5217\u5bf9\u7ed3\u679c\u96c6\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<p>ORDER BY \u8bed\u53e5\u9ed8\u8ba4\u6309\u7167\u5347\u5e8f\u5bf9\u8bb0\u5f55\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5e0c\u671b\u6309\u7167\u964d\u5e8f\u5bf9\u8bb0\u5f55\u8fdb\u884c\u6392\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528 DESC \u5173\u952e\u5b57\u3002<\/p>\n<p>\u5b9e\u4f8b\uff1a\u4ee5\uff08\u9006\uff09\u5b57\u6bcd\u987a\u5e8f\u663e\u793a\u516c\u53f8\u540d\u79f0<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT Company, OrderNumber FROM Orders ORDER BY Company \uff08DESC\uff09\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>\n<h3 id=\"group-by\">group by<\/h3>\n<\/li>\n<\/ul>\n<p>GROUP BY \u8bed\u53e5\u7528\u4e8e\u7ed3\u5408\u5408\u8ba1\u51fd\u6570\uff0c\u6839\u636e\u4e00\u4e2a\u6216\u591a\u4e2a\u5217\u5bf9\u7ed3\u679c\u96c6\u8fdb\u884c\u5206\u7ec4\u3002<\/p>\n<p>SQL GROUP BY \u8bed\u6cd5<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT column_name, aggregate_function(column_name) \nFROM table_name \nWHERE column_name operator value \nGROUP BY column_name\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>\u5bf9XML\u6587\u6863\u8fdb\u884c\u67e5\u8be2\u548c\u4fee\u6539\u7684\u51fd\u6570extractvalue() \u548c updatexml()<\/li>\n<\/ul>\n<blockquote>\n<pre><code>&gt; EXTRACTVALUE(XML_document, XPath_string);\n&gt;\n&gt; UPDATEXML(XML_document, XPath_string, new_value);\n\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>\n<h3 id=\"if\">if()<\/h3>\n<\/li>\n<\/ul>\n<p>\u8bed\u6cd5\uff1aIF(expr1,expr2,expr3)<\/p>\n<p>\u5176\u4e2d\uff0cexpr1\u662f\u5224\u65ad\u6761\u4ef6\uff0cexpr2\u548cexpr3\u662f\u7b26\u5408expr1\u7684\u81ea\u5b9a\u4e49\u7684\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<blockquote>\n<pre><code>select\nif(il.status_id = 'INV_STTS_AVAILABLE','\u5168\u65b0','\u4e8c\u624b') as status_id\nfrom inventory_location as il;\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>\n<h3 id=\"sleep\">sleep()<\/h3>\n<\/li>\n<\/ul>\n<p>\u6267\u884cselect sleep(N)\u53ef\u4ee5\u8ba9\u6b64\u8bed\u53e5\u8fd0\u884cN\u79d2\u949f<\/p>\n<ul>\n<li>\n<h3 id=\"left\">left()<\/h3>\n<\/li>\n<\/ul>\n<p>LEFT(str,len)<\/p>\n<p>\u8fd4\u56de\u6700\u5de6\u8fb9\u7684n\u4e2a\u5b57\u7b26\u7684\u5b57\u7b26\u4e32str\uff0c\u6216NULL\u5982\u679c\u4efb\u4f55\u53c2\u6570\u662fNULL\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT LEFT('foobarbar', 5);\n<\/code><\/pre>\n<\/blockquote>\n<ul>\n<li>\n<h3 id=\"count\">count()<\/h3>\n<\/li>\n<\/ul>\n<p>COUNT(column_name) \u8bed\u6cd5<\/p>\n<p>COUNT(column_name) \u51fd\u6570\u8fd4\u56de\u6307\u5b9a\u5217\u7684\u503c\u7684\u6570\u76ee\uff08NULL \u4e0d\u8ba1\u5165\uff09\uff1a<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT COUNT(column_name) FROM table_name\n<\/code><\/pre>\n<\/blockquote>\n<p>SQL COUNT(*) \u8bed\u6cd5<\/p>\n<p>COUNT(*) \u51fd\u6570\u8fd4\u56de\u8868\u4e2d\u7684\u8bb0\u5f55\u6570\uff1a<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT COUNT(*) FROM table_name\n<\/code><\/pre>\n<\/blockquote>\n<p>SQL COUNT(DISTINCT column_name) \u8bed\u6cd5<\/p>\n<p>COUNT(DISTINCT column_name) \u51fd\u6570\u8fd4\u56de\u6307\u5b9a\u5217\u7684\u4e0d\u540c\u503c\u7684\u6570\u76ee\uff1a<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">SELECT COUNT(DISTINCT column_name) FROM table_name\n<\/code><\/pre>\n<\/blockquote>\n<p>\u6ce8\u91ca\uff1aCOUNT(DISTINCT) \u9002\u7528\u4e8e ORACLE \u548c Microsoft SQL Server\uff0c\u4f46\u662f\u65e0\u6cd5\u7528\u4e8e Microsoft Access\u3002<\/p>\n<ul>\n<li>\n<h3 id=\"floor\">floor()<\/h3>\n<\/li>\n<\/ul>\n<p>FLOOR() &#8211; \u8fd4\u56de\u6700\u5927\u6574\u6570\uff0c\u4f7f\u8fd9\u4e2a\u6574\u6570\u5c0f\u4e8e\u6216\u7b49\u4e8e\u6307\u5b9a\u6570\u7684\u6570\u503c\u8fd0\u7b97\u3002<\/p>\n<ul>\n<li>\n<h3 id=\"round\">round()<\/h3>\n<\/li>\n<\/ul>\n<p>ROUND() \u2013 \u56db\u820d\u4e94\u5165\u4e00\u4e2a\u6b63\u6570\u6216\u8005\u8d1f\u6570\uff0c\u7ed3\u679c\u4e3a\u4e00\u5b9a\u957f\u5ea6\u7684\u503c\u3002<\/p>\n<ul>\n<li>\n<h3 id=\"rand\">rand()<\/h3>\n<\/li>\n<\/ul>\n<p>SQL \u6709\u4e00\u4e2a <strong>RAND<\/strong> \u51fd\u6570\uff0c\u7528\u4e8e\u4ea7\u751f 0 \u81f3 1 \u4e4b\u95f4\u7684\u968f\u673a\u6570<\/p>\n<ul>\n<li>\n<h3 id=\"length\">length()<\/h3>\n<\/li>\n<\/ul>\n<p>\u8fd4\u56de\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\uff0c\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d<\/p>\n<p>\u8bed\u6cd5\uff1a<\/p>\n<blockquote><p>LENGTH(<em>string<\/em>)<\/p><\/blockquote>\n<ul>\n<li>\n<h3 id=\"extract\">extract()<\/h3>\n<\/li>\n<\/ul>\n<p>EXTRACT() \u51fd\u6570\u7528\u4e8e\u8fd4\u56de\u65e5\u671f\/\u65f6\u95f4\u7684\u5355\u72ec\u90e8\u5206\uff0c\u6bd4\u5982\u5e74\u3001\u6708\u3001\u65e5\u3001\u5c0f\u65f6\u3001\u5206\u949f\u7b49\u7b49\u3002<\/p>\n<blockquote>\n<pre><code class=\"language-html\" lang=\"html\">EXTRACT(unit FROM date)\n<\/code><\/pre>\n<\/blockquote>\n<p><em>date<\/em> \u53c2\u6570\u662f\u5408\u6cd5\u7684\u65e5\u671f\u8868\u8fbe\u5f0f\u3002<em>unit<\/em> \u53c2\u6570\u53ef\u4ee5\u662f\u4e0b\u5217\u7684\u503c\uff1a<\/p>\n<blockquote>\n<figure>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left;\">Unit \u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left;\">MICROSECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">SECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">MINUTE<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">HOUR<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">DAY<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">WEEK<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">MONTH<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">QUARTER<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">YEAR<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">SECOND_MICROSECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">MINUTE_MICROSECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">MINUTE_SECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">HOUR_MICROSECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">HOUR_SECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">HOUR_MINUTE<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">DAY_MICROSECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">DAY_SECOND<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">DAY_MINUTE<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">DAY_HOUR<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left;\">YEAR_MONTH<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>SQL\u6ce8\u5165\u5fc5\u5907\u77e5\u8bc6\u521d\u7ea7 SQL\u6ce8\u5165\u5fc5\u5907\u77e5\u8bc6\u521d\u7ea7 \u9996\u5148SQL\u8bed\u53e5\u5bf9\u5927\u5c0f\u5199\u4e0d\u654f\u611f\uff0c\u8fd9\u4e5f\u5bfc\u81f4\u4e86\u540e\u53f0\u7a0b\u5e8f\u5bf9\u5927\u5c0f\u5199\u7684\u68c0\u6d4b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/daishen.ltd\/index.php?rest_route=\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daishen.ltd\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daishen.ltd\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daishen.ltd\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daishen.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":1,"href":"https:\/\/daishen.ltd\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/daishen.ltd\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/daishen.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daishen.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daishen.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}