Skip to content

Commit

Permalink
[typo](docs) add show collation doc description and example (#22370)
Browse files Browse the repository at this point in the history
  • Loading branch information
zy-kkk authored Jul 30, 2023
1 parent 0e7f63f commit 2b9a95f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,32 @@ under the License.

### Description

In Doris, the `SHOW COLLATION` command is used to display the character set collations available in the database. A collation is a set of rules that determine how data is sorted and compared. These rules affect the storage and retrieval of character data. Doris currently mainly supports the proofreading method utf8_general_ci.

The `SHOW COLLATION` command returns the following fields:

* Collation: The collation name
* Charset: The character set
* Id: The collation's ID
* Default: Whether this is the default collation for the character set
* Compiled: Whether the collation is compiled
* Sortlen: Sort length

### Example

```sql
mysql> show collation;
+-----------------+---------+------+---------+----------+---------+
| Collation | Charset | Id | Default | Compiled | Sortlen |
+-----------------+---------+------+---------+----------+---------+
| utf8_general_ci | utf8 | 33 | Yes | Yes | 1 |
+-----------------+---------+------+---------+----------+---------+
```

### Keywords

SHOW, COLLATION

### Best Practice

Use the `SHOW COLLATION` command to give you an idea of the collations available in the database and their properties. This information can help ensure that your character data is sorted and compared as expected. If you have problems comparing or sorting characters, it can be helpful to check your collation settings to make sure they are what you expect.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,32 @@ under the License.

### Description

在 Doris 中,`SHOW COLLATION` 命令用于显示数据库中可用的字符集校对。校对是一组决定数据如何排序和比较的规则。这些规则会影响字符数据的存储和检索。Doris 目前主要支持 utf8_general_ci 这一种校对方式。

`SHOW COLLATION` 命令返回以下字段:

* Collation:校对名称
* Charset:字符集
* Id:校对的ID
* Default:是否是该字符集的默认校对
* Compiled:是否已编译
* Sortlen:排序长度

### Example

```sql
mysql> show collation;
+-----------------+---------+------+---------+----------+---------+
| Collation | Charset | Id | Default | Compiled | Sortlen |
+-----------------+---------+------+---------+----------+---------+
| utf8_general_ci | utf8 | 33 | Yes | Yes | 1 |
+-----------------+---------+------+---------+----------+---------+
```

### Keywords

SHOW, COLLATION

### Best Practice

使用 `SHOW COLLATION` 命令可以让你了解数据库中可用的校对规则及其特性。这些信息可以帮助确保你的字符数据按照预期的方式进行排序和比较。如果遇到字符比较或排序的问题,检查校对设置,确保它们符合你的预期,会是个很有帮助的操作。

0 comments on commit 2b9a95f

Please sign in to comment.