Skip to content

Commit b6c871a

Browse files
authored
Merge pull request #2623 from Junnplus/crc32-doc
[DOC] add doc for crc32 function
2 parents ede955c + 7f79fd3 commit b6c871a

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
id: numeric-crc32
3+
title: CRC32
4+
---
5+
6+
Returns the CRC32 checksum of a string.
7+
8+
## Syntax
9+
10+
```sql
11+
CRC32(x)
12+
```
13+
14+
## Arguments
15+
16+
| Arguments | Description |
17+
| ----------- | ----------- |
18+
| x | The argument is expected to be a string and (if possible) is treated as one if it is not. |
19+
20+
## Return Type
21+
22+
UInt32.
23+
24+
## Examples
25+
26+
```
27+
mysql> SELECT CRC32('MySQL');
28+
+----------------+
29+
| CRC32('MySQL') |
30+
+----------------+
31+
| 3259397556 |
32+
+----------------+
33+
1 row in set (0.09 sec)
34+
35+
mysql> SELECT CRC32('mysql');
36+
+----------------+
37+
| CRC32('mysql') |
38+
+----------------+
39+
| 2501908538 |
40+
+----------------+
41+
1 row in set (0.01 sec)
42+
43+
mysql> SELECT CRC32(NULL);
44+
+-------------+
45+
| CRC32(NULL) |
46+
+-------------+
47+
| NULL |
48+
+-------------+
49+
1 row in set (0.00 sec)
50+
51+
mysql> SELECT CRC32(12);
52+
+------------+
53+
| CRC32(12) |
54+
+------------+
55+
| 1330857165 |
56+
+------------+
57+
1 row in set (0.01 sec)
58+
```

website/databend/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ nav:
202202
- COS: sqlstatement/numeric-functions/cos.md
203203
- TAN: sqlstatement/numeric-functions/tan.md
204204
- COT: sqlstatement/numeric-functions/cot.md
205+
- CRC32: sqlstatement/numeric-functions/crc32.md
205206
- String Functions:
206207
- SUBSTRING: sqlstatement/string-functions/substring.md
207208
- Test Functions:

0 commit comments

Comments
 (0)