Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): escaping the '*' chars in the doc to prevent rendering error #1005

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions p3c-gitbook/MySQL数据库/SQL语句.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## (三) SQL语句
1. 【强制】不要使用count(列名)或count(常量)来替代count(*),count(*)是SQL92定义的标准统计行数的语法,跟数据库无关,跟NULL和非NULL无关。
1. 【强制】不要使用count(列名)或count(常量)来替代count(\*),count(\*)是SQL92定义的标准统计行数的语法,跟数据库无关,跟NULL和非NULL无关。
<br><span style="color:orange">说明</span>:count(*)会统计值为NULL的行,而count(列名)不会统计此列为NULL值的行。
2. 【强制】count(distinct col) 计算该列除NULL之外的不重复行数,注意 count(distinct col1, col2) 如果其中一列全为NULL,那么即使另一列有不同的值,也返回为0。
3. 【强制】当某一列的值全是NULL时,count(col)的返回结果为0,但sum(col)的返回结果为NULL,因此使用sum()时需注意NPE问题。
Expand All @@ -21,4 +21,4 @@
SELECT CHARACTER_LENGTH("轻松工作"); 返回为4</pre>
如果需要存储表情,那么选择utf8mb4来进行存储,注意它与utf-8编码的区别。
11. 【参考】 TRUNCATE TABLE 比 DELETE 速度快,且使用的系统和事务日志资源少,但TRUNCATE无事务且不触发trigger,有可能造成事故,故不建议在开发代码中使用此语句。
<br><span style="color:orange">说明</span>:TRUNCATE TABLE 在功能上与不带 WHERE 子句的 DELETE 语句相同。
<br><span style="color:orange">说明</span>:TRUNCATE TABLE 在功能上与不带 WHERE 子句的 DELETE 语句相同。