mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-08-26 00:16:14 +08:00
doc: docs/mysql.md (#639)
* update neo4j.md
* update neo4j.md 73106942ca
This commit is contained in:
190
CONTRIBUTORS.svg
190
CONTRIBUTORS.svg
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 9.2 MiB After Width: | Height: | Size: 9.2 MiB |
291
docs/mysql.html
291
docs/mysql.html
@@ -31,7 +31,7 @@
|
|||||||
<p>本备忘单旨在快速理解 <a href="https://mysql.com">MySQL</a> 所涉及的主要概念,提供了最常用的SQL语句,供您参考。</p>
|
<p>本备忘单旨在快速理解 <a href="https://mysql.com">MySQL</a> 所涉及的主要概念,提供了最常用的SQL语句,供您参考。</p>
|
||||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#介绍">介绍</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#登录mysql">登录MySQL</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#常用的">常用的</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#数据库-database">数据库 Database</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#表-table">表 Table</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#proccess">Proccess</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查看-mysql-信息">查看 MySQL 信息</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#退出mysql会话">退出MySQL会话</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#备份">备份</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#mysql-示例">MySQL 示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理表格">管理表格</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#从表中查询数据">从表中查询数据</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#从多个表查询">从多个表查询</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#使用-sql-约束">使用 SQL 约束</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#修改数据">修改数据</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理视图">管理视图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理触发器">管理触发器</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#when">WHEN</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#event">EVENT</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#trigger_type">TRIGGER_TYPE</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理索引">管理索引</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#mysql-数据类型">MySQL 数据类型</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#strings">Strings</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#date--time">Date & time</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#numeric">Numeric</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#介绍">介绍</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#登录mysql">登录MySQL</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#常用的">常用的</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#数据库-database">数据库 Database</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#表-table">表 Table</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#proccess">Proccess</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查看-mysql-信息">查看 MySQL 信息</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#退出mysql会话">退出MySQL会话</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#备份">备份</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#mysql-示例">MySQL 示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理表格">管理表格</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#从表中查询数据">从表中查询数据</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#从多个表查询">从多个表查询</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#使用-sql-约束">使用 SQL 约束</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#修改数据">修改数据</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理视图">管理视图</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理触发器">管理触发器</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#when">WHEN</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#event">EVENT</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#trigger_type">TRIGGER_TYPE</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#管理索引">管理索引</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#mysql-数据类型">MySQL 数据类型</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#strings">Strings</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#date--time">Date & time</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#numeric">Numeric</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#函数">函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#聚合函数">聚合函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数学函数">数学函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#日期和时间函数">日期和时间函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#字符串函数">字符串函数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#高级函数">高级函数</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist row-span-3"><div class="wrap-header h3wrap"><h3 id="介绍"><a aria-hidden="true" tabindex="-1" href="#介绍"><span class="icon icon-link"></span></a>介绍</h3><div class="wrap-body">
|
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist row-span-3"><div class="wrap-header h3wrap"><h3 id="介绍"><a aria-hidden="true" tabindex="-1" href="#介绍"><span class="icon icon-link"></span></a>介绍</h3><div class="wrap-body">
|
||||||
<!--rehype:wrap-class=row-span-3-->
|
<!--rehype:wrap-class=row-span-3-->
|
||||||
<p>MySQL 为关系型数据库(Relational Database Management System),一个关系型数据库由一个或数个表格组成,如下所示的一个表格</p>
|
<p>MySQL 为关系型数据库(Relational Database Management System),一个关系型数据库由一个或数个表格组成,如下所示的一个表格</p>
|
||||||
@@ -616,6 +616,295 @@
|
|||||||
|
|
||||||
|
|
||||||
<table><thead><tr><th>-</th><th>-</th></tr></thead><tbody><tr><td><code>TINYINT x</code></td><td>Integer (-128 to 127)</td></tr><tr><td><code>SMALLINT x</code></td><td>Integer (-32768 to 32767)</td></tr><tr><td><code>MEDIUMINT x</code></td><td>Integer (-8388608 to 8388607)</td></tr><tr><td><code>INT x</code></td><td>Integer (-2147483648 to 2147483647)</td></tr><tr><td><code>BIGINT x</code></td><td>Integer (-9223372036854775808 to 9223372036854775807)</td></tr><tr><td><code>FLOAT</code></td><td>Decimal (precise to 23 digits)</td></tr><tr><td><code>DOUBLE</code></td><td>Decimal (24 to 53 digits)</td></tr><tr><td><code>DECIMAL</code></td><td>"DOUBLE" stored as string</td></tr></tbody></table>
|
<table><thead><tr><th>-</th><th>-</th></tr></thead><tbody><tr><td><code>TINYINT x</code></td><td>Integer (-128 to 127)</td></tr><tr><td><code>SMALLINT x</code></td><td>Integer (-32768 to 32767)</td></tr><tr><td><code>MEDIUMINT x</code></td><td>Integer (-8388608 to 8388607)</td></tr><tr><td><code>INT x</code></td><td>Integer (-2147483648 to 2147483647)</td></tr><tr><td><code>BIGINT x</code></td><td>Integer (-9223372036854775808 to 9223372036854775807)</td></tr><tr><td><code>FLOAT</code></td><td>Decimal (precise to 23 digits)</td></tr><tr><td><code>DOUBLE</code></td><td>Decimal (24 to 53 digits)</td></tr><tr><td><code>DECIMAL</code></td><td>"DOUBLE" stored as string</td></tr></tbody></table>
|
||||||
|
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="函数"><a aria-hidden="true" tabindex="-1" href="#函数"><span class="icon icon-link"></span></a>函数</h2><div class="wrap-body">
|
||||||
|
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="聚合函数"><a aria-hidden="true" tabindex="-1" href="#聚合函数"><span class="icon icon-link"></span></a>聚合函数</h3><div class="wrap-body">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table><thead><tr><th align="left">函数</th><th align="left">解释</th></tr></thead><tbody><tr><td align="left"><code>SUM()</code></td><td align="left">计算一列值的总和</td></tr><tr><td align="left"><code>AVG()</code></td><td align="left">计算一列值的平均值</td></tr><tr><td align="left"><code>COUNT()</code></td><td align="left">计算行数,可选择性地忽略NULL值</td></tr><tr><td align="left"><code>MAX()</code></td><td align="left">找出一列的最大值</td></tr><tr><td align="left"><code>MIN()</code></td><td align="left">找出一列的最小值</td></tr></tbody></table>
|
||||||
|
</div></div></div><div class="wrap h3body-not-exist col-span-2"><div class="wrap-header h3wrap"><h3 id="数学函数"><a aria-hidden="true" tabindex="-1" href="#数学函数"><span class="icon icon-link"></span></a>数学函数</h3><div class="wrap-body">
|
||||||
|
<!--rehype:wrap-class=col-span-2 -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table><thead><tr><th align="left">函数</th><th align="left">解释</th><th align="left">示例语法</th><th align="left">结果</th></tr></thead><tbody><tr><td align="left"><code>ABS(x)</code></td><td align="left">返回数值的绝对值</td><td align="left"><code>ABS(-5)</code></td><td align="left">5</td></tr><tr><td align="left"><code>ROUND(x,y)</code></td><td align="left">四舍五入到指定的小数位数,y为小数位数,默认为0</td><td align="left"><code>ROUND(3.1415,2)</code></td><td align="left">3.14</td></tr><tr><td align="left"><code>FLOOR(x)</code></td><td align="left">向下取整至最接近的整数</td><td align="left"><code>FLOOR(3.7)</code></td><td align="left">3</td></tr><tr><td align="left"><code>CEIL(x)</code></td><td align="left">向上取整至最接近的整数</td><td align="left"><code>CEIL(3.3)</code></td><td align="left">4</td></tr><tr><td align="left"><code>SQRT(x)</code></td><td align="left">返回一个数的平方根</td><td align="left"><code>SQRT(16)</code></td><td align="left">4</td></tr><tr><td align="left"><code>MOD(x,y)</code></td><td align="left">返回x除以y的余数</td><td align="left"><code>MOD(10,3)</code></td><td align="left">1</td></tr><tr><td align="left"><code>RAND([seed])</code></td><td align="left">返回0到1之间的随机数,可选种子值</td><td align="left"><code>RAND()</code> 或 <code>RAND(123)</code></td><td align="left">0.345...</td></tr></tbody></table>
|
||||||
|
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="日期和时间函数"><a aria-hidden="true" tabindex="-1" href="#日期和时间函数"><span class="icon icon-link"></span></a>日期和时间函数</h3><div class="wrap-body">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table><thead><tr><th align="left">函数</th><th align="left">解释</th></tr></thead><tbody><tr><td align="left"><code>NOW()</code></td><td align="left">返回当前日期和时间</td></tr><tr><td align="left"><code>CURDATE()</code></td><td align="left">返回当前日期</td></tr><tr><td align="left"><code>CURTIME()</code></td><td align="left">返回当前时间</td></tr><tr><td align="left"><code>DATE_FORMAT()</code></td><td align="left">格式化日期时间输出</td></tr><tr><td align="left"><code>DATEDIFF()</code></td><td align="left">计算两个日期之间相差的天数</td></tr><tr><td align="left"><code>STR_TO_DATE()</code></td><td align="left">将字符串转换为日期格式</td></tr></tbody></table>
|
||||||
|
</div></div></div><div class="wrap h3body-not-exist col-span-2"><div class="wrap-header h3wrap"><h3 id="字符串函数"><a aria-hidden="true" tabindex="-1" href="#字符串函数"><span class="icon icon-link"></span></a>字符串函数</h3><div class="wrap-body">
|
||||||
|
<!--rehype:wrap-class=col-span-2 -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table><thead><tr><th align="left">函数</th><th align="left">解释</th><th>示例语法</th><th>结果</th></tr></thead><tbody><tr><td align="left"><code>CONCAT(s1,s2,...)</code></td><td align="left">连接两个或更多字符串</td><td><code>CONCAT('Hello, ','World!')</code></td><td>'Hello, World!'</td></tr><tr><td align="left"><code>LOWER(str)</code></td><td align="left">转换为小写</td><td><code>LOWER('HELLO')</code></td><td>'hello'</td></tr><tr><td align="left"><code>UPPER(str)</code></td><td align="left">转换为大写</td><td><code>UPPER('world')</code></td><td>'WORLD'</td></tr><tr><td align="left"><code>TRIM(str)</code></td><td align="left">去除字符串两端空格</td><td><code>TRIM(' Hello ')</code></td><td>'Hello'</td></tr><tr><td align="left"><code>LEFT(str,len)</code></td><td align="left">提取字符串左侧的若干字符</td><td><code>LEFT('Hello', 3)</code></td><td>'Hel'</td></tr><tr><td align="left"><code>RIGHT(str,len)</code></td><td align="left">提取字符串右侧的若干字符</td><td><code>RIGHT('Hello', 2)</code></td><td>'lo'</td></tr><tr><td align="left"><code>SUBSTR(str,pos,len)</code></td><td align="left">提取字符串中的一部分</td><td><code>SUBSTR('Hello', 2, 3)</code></td><td>'ell'</td></tr><tr><td align="left"><code>REPLACE(str,from_str,to_str)</code></td><td align="left">替换字符串中的部分文本</td><td><code>REPLACE('Hello', 'l', 'L')</code></td><td>'HeLLo'</td></tr></tbody></table>
|
||||||
|
</div></div></div><div class="wrap h3body-not-exist col-span-3"><div class="wrap-header h3wrap"><h3 id="高级函数"><a aria-hidden="true" tabindex="-1" href="#高级函数"><span class="icon icon-link"></span></a>高级函数</h3><div class="wrap-body">
|
||||||
|
<!--rehype:wrap-class=col-span-3 -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table><thead><tr><th>函数</th><th>解释</th><th>示例语法</th><th>结果</th></tr></thead><tbody><tr><td>BIN(x)</td><td>返回 x 的二进制编码,x 为十进制数。</td><td><code>BIN(2)</code></td><td><code>10</code></td></tr><tr><td>BINARY(s)</td><td>将字符串 s 转换为二进制字符串。</td><td><code>BINARY 'RUNOOB'</code></td><td><code>'RUNOOB'</code>(显示效果,实际存储为二进制)</td></tr><tr><td>CASE</td><td>复合条件函数,根据条件返回不同结果。</td><td><code>CASE WHEN 1 > 0 THEN '1 > 0' WHEN 2 > 0 THEN '2 > 0' ELSE '3 > 0' END</code></td><td><code>'1 > 0'</code></td></tr><tr><td>CAST(x AS type)</td><td>转换数据类型。</td><td><code>CAST('2017-08-29' AS DATE)</code></td><td><code>2017-08-29</code></td></tr><tr><td>COALESCE(expr1, expr2, ..., expr_n)</td><td>返回第一个非空表达式的值。</td><td><code>COALESCE(NULL, NULL, 'runoob.com', NULL, 'google.com')</code></td><td><code>'runoob.com'</code></td></tr><tr><td>CONNECTION_ID()</td><td>返回当前连接的唯一ID。</td><td><code>CONNECTION_ID()</code></td><td><code>4292835</code>(示例值)</td></tr><tr><td>CONV(x, f1, f2)</td><td>将 f1 进制数转换为 f2 进制数。</td><td><code>CONV(15, 10, 2)</code></td><td><code>1111</code></td></tr><tr><td>CONVERT(s USING cs)</td><td>转换字符串 s 的字符集为 cs。</td><td><code>CHARSET(CONVERT('ABC' USING gbk))</code></td><td><code>gbk</code></td></tr><tr><td>CURRENT_USER()</td><td>返回当前用户。</td><td><code>CURRENT_USER()</code></td><td><code>guest@%</code></td></tr><tr><td>DATABASE()</td><td>返回当前数据库名。</td><td><code>DATABASE()</code></td><td><code>runoob</code></td></tr><tr><td>IF(expr, v1, v2)</td><td>条件表达式,expr 为真则 v1,否则 v2。</td><td><code>IF(1 > 0, '正确', '错误')</code></td><td><code>'正确'</code></td></tr><tr><td>IFNULL(v1, v2)</td><td>如果 v1 不为 NULL,则返回 v1,否则返回 v2。</td><td><code>IFNULL(NULL, 'Hello Word')</code></td><td><code>'Hello Word'</code></td></tr><tr><td>ISNULL(expression)</td><td>判断表达式是否为 NULL。</td><td><code>ISNULL(NULL)</code></td><td><code>1</code></td></tr><tr><td>LAST_INSERT_ID()</td><td>返回最近生成的 AUTO_INCREMENT 值。</td><td><code>LAST_INSERT_ID()</code></td><td><code>6</code>(示例值)</td></tr><tr><td>NULLIF(expr1, expr2)</td><td>若 expr1 等于 expr2,则返回 NULL,否则返回 expr1。</td><td><code>NULLIF(25, 25)</code></td><td><code>NULL</code></td></tr></tbody></table>
|
||||||
</div></div></div></div></div><div class="wrap h2body-not-exist"><div class="wrap-header h2wrap"><h2 id="另见"><a aria-hidden="true" tabindex="-1" href="#另见"><span class="icon icon-link"></span></a>另见</h2><div class="wrap-body">
|
</div></div></div></div></div><div class="wrap h2body-not-exist"><div class="wrap-header h2wrap"><h2 id="另见"><a aria-hidden="true" tabindex="-1" href="#另见"><span class="icon icon-link"></span></a>另见</h2><div class="wrap-body">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://www.w3school.com.cn/sql/index.asp">SQL 基础教程</a> <em>(w3school.com.cn)</em></li>
|
<li><a href="http://www.w3school.com.cn/sql/index.asp">SQL 基础教程</a> <em>(w3school.com.cn)</em></li>
|
||||||
|
16
index.html
16
index.html
@@ -886,14 +886,14 @@
|
|||||||
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang"><img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"></a>
|
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang"><img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"></a>
|
||||||
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"></a>
|
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"></a>
|
||||||
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"></a>
|
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"></a>
|
||||||
<a href="https://github.com/Alex20180512" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"></a>
|
|
||||||
<a href="https://github.com/undefined-hestudio" title="undefined"><img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"></a>
|
|
||||||
<a href="https://github.com/eryajf" title="二丫讲梵"><img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"></a>
|
|
||||||
<a href="https://github.com/k23223" title="k23223"><img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"></a>
|
|
||||||
<a href="https://github.com/expoli" title="expoli"><img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"></a>
|
|
||||||
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"></a>
|
|
||||||
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"></a>
|
|
||||||
<a href="https://github.com/LesterChang0987" title="LesterChang0987"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="LesterChang0987"></a>
|
<a href="https://github.com/LesterChang0987" title="LesterChang0987"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="LesterChang0987"></a>
|
||||||
|
<a href="https://github.com/Alex20180512" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"></a>
|
||||||
|
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"></a>
|
||||||
|
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"></a>
|
||||||
|
<a href="https://github.com/expoli" title="expoli"><img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"></a>
|
||||||
|
<a href="https://github.com/k23223" title="k23223"><img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"></a>
|
||||||
|
<a href="https://github.com/eryajf" title="二丫讲梵"><img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"></a>
|
||||||
|
<a href="https://github.com/undefined-hestudio" title="undefined"><img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"></a>
|
||||||
<a href="https://github.com/qyl27" title="秋 雨落"><img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"></a>
|
<a href="https://github.com/qyl27" title="秋 雨落"><img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"></a>
|
||||||
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice"><img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"></a>
|
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice"><img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"></a>
|
||||||
<a href="https://github.com/MackDing" title="Blossom"><img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"></a>
|
<a href="https://github.com/MackDing" title="Blossom"><img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"></a>
|
||||||
@@ -1390,7 +1390,7 @@
|
|||||||
<!--rehype:class=home-card home-links-->
|
<!--rehype:class=home-card home-links-->
|
||||||
<p>如果你有资源,可以很方便<a href="https://github.com/jaywcjlove/reference/issues/102#issue-1451649637">部署 web 版</a>,这非常简单,只需要克隆 <a href="https://github.com/jaywcjlove/reference/tree/gh-pages">gh-pages</a> 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p>
|
<p>如果你有资源,可以很方便<a href="https://github.com/jaywcjlove/reference/issues/102#issue-1451649637">部署 web 版</a>,这非常简单,只需要克隆 <a href="https://github.com/jaywcjlove/reference/tree/gh-pages">gh-pages</a> 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p>
|
||||||
|
|
||||||
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 <a href="https://wangchujiang.com/#/app" target="_blank">Kenny Wang</a>. Updated on 2024/05/07 09:53:16</footer></footer><script src="data.js?v=1.5.3" defer></script><script src="js/fuse.min.js?v=1.5.3" defer></script><script src="js/main.js?v=1.5.3" defer></script><div id="mysearch"><div class="mysearch-box"><div class="mysearch-input"><div><svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 18 18">
|
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 <a href="https://wangchujiang.com/#/app" target="_blank">Kenny Wang</a>. Updated on 2024/05/07 14:20:21</footer></footer><script src="data.js?v=1.5.3" defer></script><script src="js/fuse.min.js?v=1.5.3" defer></script><script src="js/main.js?v=1.5.3" defer></script><div id="mysearch"><div class="mysearch-box"><div class="mysearch-input"><div><svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 18 18">
|
||||||
<path fill="currentColor" d="M17.71,16.29 L14.31,12.9 C15.4069846,11.5024547 16.0022094,9.77665502 16,8 C16,3.581722 12.418278,0 8,0 C3.581722,0 0,3.581722 0,8 C0,12.418278 3.581722,16 8,16 C9.77665502,16.0022094 11.5024547,15.4069846 12.9,14.31 L16.29,17.71 C16.4777666,17.8993127 16.7333625,18.0057983 17,18.0057983 C17.2666375,18.0057983 17.5222334,17.8993127 17.71,17.71 C17.8993127,17.5222334 18.0057983,17.2666375 18.0057983,17 C18.0057983,16.7333625 17.8993127,16.4777666 17.71,16.29 Z M2,8 C2,4.6862915 4.6862915,2 8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 Z"></path>
|
<path fill="currentColor" d="M17.71,16.29 L14.31,12.9 C15.4069846,11.5024547 16.0022094,9.77665502 16,8 C16,3.581722 12.418278,0 8,0 C3.581722,0 0,3.581722 0,8 C0,12.418278 3.581722,16 8,16 C9.77665502,16.0022094 11.5024547,15.4069846 12.9,14.31 L16.29,17.71 C16.4777666,17.8993127 16.7333625,18.0057983 17,18.0057983 C17.2666375,18.0057983 17.5222334,17.8993127 17.71,17.71 C17.8993127,17.5222334 18.0057983,17.2666375 18.0057983,17 C18.0057983,16.7333625 17.8993127,16.4777666 17.71,16.29 Z M2,8 C2,4.6862915 4.6862915,2 8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 Z"></path>
|
||||||
</svg><input id="mysearch-input" type="search" placeholder="搜索" autocomplete="off"><div class="mysearch-clear"></div></div><button id="mysearch-close" type="button">搜索</button></div><div class="mysearch-result"><div id="mysearch-menu"></div><div id="mysearch-content"></div></div></div></div></body>
|
</svg><input id="mysearch-input" type="search" placeholder="搜索" autocomplete="off"><div class="mysearch-clear"></div></div><button id="mysearch-close" type="button">搜索</button></div><div class="mysearch-result"><div id="mysearch-menu"></div><div id="mysearch-content"></div></div></div></div></body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user