Skip to content

Commit ce25358

Browse files
AI Translate 06-string-functions to Simplified-Chinese (#2424)
* [INIT] Start translation to Simplified-Chinese * 🌐 Translate char.md to Simplified-Chinese --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 3edb893 commit ce25358

File tree

2 files changed

+62
-13
lines changed

2 files changed

+62
-13
lines changed

.translation-init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Translation initialization: 2025-06-09T05:02:31.134767
1+
Translation initialization: 2025-06-09T05:44:40.106914

docs/cn/sql-reference/20-sql-functions/06-string-functions/char.md

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,81 @@ id: string-char
33
title: CHAR
44
---
55

6-
返回传递的每个整数对应的字符。
6+
import FunctionDescription from '@site/src/components/FunctionDescription';
7+
8+
<FunctionDescription description="Introduced or updated: v1.2.752"/>
9+
10+
返回每个传入整数对应的字符。该函数将每个整数转换为其对应的 Unicode 字符。
711

812
## 语法
913

1014
```sql
1115
CHAR(N, ...)
16+
CHR(N)
1217
```
1318

1419
## 参数
1520

16-
| 参数 | 描述 |
17-
|-----------|--------------|
18-
| N | 数值列 |
21+
| 参数 | 描述 |
22+
|-----------|----------------------------------------------------------------|
23+
| N | 表示 Unicode 码点(0 到 2^32-1)的整数值。 |
1924

2025
## 返回类型
2126

22-
`BINARY`
27+
`STRING`
28+
29+
## 说明
30+
31+
- 接受任何整数类型(自动转换为 Int64)。
32+
- 对于无效的码点,返回空字符串('')并记录错误。
33+
- `chr``char` 的别名。
34+
- NULL 输入导致 NULL 输出。
2335

2436
## 示例
2537

2638
```sql
27-
SELECT CHAR(77,121,83,81,76) as a, a::String;
28-
┌────────────────────────┐
29-
│ a │ a::string │
30-
│ Binary │ String │
31-
├────────────┼───────────┤
32-
│ 4D7953514C │ MySQL │
33-
└────────────────────────┘
39+
-- 基本用法
40+
SELECT CHAR(65, 66, 67);
41+
┌───────┐
42+
char
43+
│ String│
44+
├───────┤
45+
│ ABC │
46+
└───────┘
47+
48+
-- 使用 CHR 别名
49+
SELECT CHR(68);
50+
┌───────┐
51+
│ chr │
52+
│ String│
53+
├───────┤
54+
│ D │
55+
└───────┘
56+
57+
-- 从多个码点创建字符串
58+
SELECT CHAR(77,121,83,81,76);
59+
┌───────┐
60+
char
61+
│ String│
62+
├───────┤
63+
│ MySQL │
64+
└───────┘
65+
66+
-- 从不同整数类型自动转换
67+
SELECT CHAR(CAST(65 AS UInt16));
68+
┌───────┐
69+
char
70+
│ String│
71+
├───────┤
72+
│ A │
73+
└───────┘
74+
75+
-- NULL 处理
76+
SELECT CHAR(NULL);
77+
┌───────┐
78+
char
79+
│ String│
80+
├───────┤
81+
NULL
82+
└───────┘
3483
```

0 commit comments

Comments
 (0)