From cceb80377ca26d891815c0e21c7440df54b74805 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 6 Feb 2024 10:40:10 +0800 Subject: [PATCH 1/4] Add temp.md --- temp.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 temp.md diff --git a/temp.md b/temp.md new file mode 100644 index 000000000000..af27ff4986a7 --- /dev/null +++ b/temp.md @@ -0,0 +1 @@ +This is a test file. \ No newline at end of file From 341551f8026977fe16dcfeeb2ee1f5188f6e8665 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 6 Feb 2024 10:40:15 +0800 Subject: [PATCH 2/4] Delete temp.md --- temp.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 temp.md diff --git a/temp.md b/temp.md deleted file mode 100644 index af27ff4986a7..000000000000 --- a/temp.md +++ /dev/null @@ -1 +0,0 @@ -This is a test file. \ No newline at end of file From 5e931e15309a8dc0634bad21c00f3d7624336cdc Mon Sep 17 00:00:00 2001 From: qiancai Date: Tue, 6 Feb 2024 10:53:57 +0800 Subject: [PATCH 3/4] Update string-functions.md --- functions-and-operators/string-functions.md | 31 +++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index ae2ac9b9cde1..ee2e3987aa95 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -92,11 +92,38 @@ SELECT BIN(-7); ### [`CHAR_LENGTH()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_char-length) -返回字符串的字符长度 +`CHAR_LENGTH()` 函数用于获取输入参数中字符的总数。 + +示例: + +```sql +SELECT CHAR_LENGTH("TiDB") AS LengthOfString; + ++----------------+ +| LengthOfString | ++----------------+ +| 4 | ++----------------+ +``` + +```sql +SELECT CustomerName, CHAR_LENGTH(CustomerName) AS LenghtOfName FROM Customers; + ++--------------------+--------------+ +| CustomerName | LenghtOfName | ++--------------------+--------------+ +| Albert Einstein | 15 | +| Robert Oppenheimer | 18 | ++--------------------+--------------+ +``` + +> **注意:** +> +> 上面这个示例假设数据库中存在一个名为 `Customers` 的表,表中有一个名为 `CustomerName` 的列。 ### [`CHARACTER_LENGTH()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_character-length) -与 `CHAR_LENGTH()` 功能相同 +`CHARACTER_LENGTH()` 函数与 `CHAR_LENGTH()` 函数作用相同,返回结果相同,可以互换使用。 ### [`CONCAT()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_concat) From c0887922b04362c779058694f521d0cc2b3b084c Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 6 Feb 2024 10:55:08 +0800 Subject: [PATCH 4/4] Update functions-and-operators/string-functions.md --- functions-and-operators/string-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/string-functions.md b/functions-and-operators/string-functions.md index ee2e3987aa95..d4ba442f22c6 100644 --- a/functions-and-operators/string-functions.md +++ b/functions-and-operators/string-functions.md @@ -123,7 +123,7 @@ SELECT CustomerName, CHAR_LENGTH(CustomerName) AS LenghtOfName FROM Customers; ### [`CHARACTER_LENGTH()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_character-length) -`CHARACTER_LENGTH()` 函数与 `CHAR_LENGTH()` 函数作用相同,返回结果相同,可以互换使用。 +`CHARACTER_LENGTH()` 函数与 `CHAR_LENGTH()` 函数功能相同,返回结果相同,可以互换使用。 ### [`CONCAT()`](https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_concat)