[typo](docs)Optimized string and date function doc (#12949)

This commit is contained in:
zy-kkk
2022-09-26 09:26:12 +08:00
committed by GitHub
parent 91134cff61
commit 978dae267e
127 changed files with 613 additions and 150 deletions

View File

@ -57,4 +57,4 @@ MySQL [test]> select append_trailing_char_if_absent('ac','c');
### keywords
APPEND_TRAILING_CHAR_IF_ABSENT
APPEND_TRAILING_CHAR_IF_ABSENT

View File

@ -51,4 +51,4 @@ mysql> select ascii('234');
+--------------+
```
### keywords
ASCII
ASCII

View File

@ -51,4 +51,4 @@ mysql> select bit_length("中国");
+----------------------+
```
### keywords
BIT_LENGTH
BIT_LENGTH

View File

@ -1,6 +1,6 @@
---
{
"title": "CHAR_LENGTH",
"title": "char_length",
"language": "zh-CN"
}
---
@ -51,4 +51,4 @@ mysql> select char_length("中国");
+-----------------------+
```
### keywords
CHAR_LENGTH, CHARACTER_LENGTH
CHAR_LENGTH, CHARACTER_LENGTH

View File

@ -58,4 +58,4 @@ mysql> select concat("a", null, "c");
+------------------------+
```
### keywords
CONCAT
CONCAT

View File

@ -82,4 +82,4 @@ mysql> select concat_ws("or", ["d", NULL,"is"]);
+-----------------------------------------+
```
### keywords
CONCAT_WS,CONCAT,WS,ARRAY
CONCAT_WS,CONCAT,WS,ARRAY

View File

@ -59,4 +59,4 @@ mysql> select elt(2, 'aaa', 'bbb');
+-----------------------+
```
### keywords
ELT
ELT

View File

@ -50,4 +50,4 @@ mysql> select ends_with("Hello doris", "Hello");
+-----------------------------------+
```
### keywords
ENDS_WITH
ENDS_WITH

View File

@ -44,4 +44,4 @@ mysql> select find_in_set("b", "a,b,c");
+---------------------------+
```
### keywords
FIND_IN_SET,FIND,IN,SET
FIND_IN_SET,FIND,IN,SET

View File

@ -82,4 +82,4 @@ mysql> select hex(-1);
+------------------+
```
### keywords
HEX
HEX

View File

@ -51,4 +51,4 @@ mysql> select instr("abc", "d");
+-------------------+
```
### keywords
INSTR
INSTR

View File

@ -34,4 +34,4 @@ under the License.
`lower`一致
### keywords
LCASE
LCASE

View File

@ -44,4 +44,4 @@ mysql> select left("Hello doris",5);
+------------------------+
```
### keywords
LEFT
LEFT

View File

@ -51,4 +51,4 @@ mysql> select length("中国");
+------------------+
```
### keywords
LENGTH
LENGTH

View File

@ -80,4 +80,4 @@ mysql > select k1 from test where k1 like 'a';
```
### keywords
LIKE
LIKE

View File

@ -82,4 +82,4 @@ mysql > select k1 from test where k1 not like 'a';
```
### keywords
LIKE, NOT, NOT LIKE
LIKE, NOT, NOT LIKE

View File

@ -58,4 +58,4 @@ mysql> SELECT LOCATE('bar', 'foobarbar', 5);
+-------------------------------+
```
### keywords
LOCATE
LOCATE

View File

@ -44,4 +44,4 @@ mysql> SELECT lower("AbC123");
+-----------------+
```
### keywords
LOWER
LOWER

View File

@ -51,4 +51,4 @@ mysql> SELECT lpad("hi", 1, "xy");
+---------------------+
```
### keywords
LPAD
LPAD

View File

@ -31,17 +31,17 @@ under the License.
`VARCHAR ltrim(VARCHAR str)`
将参数 str 中从开始部分连续出现的空格去掉
将参数 str 中从左侧部分开始部分连续出现的空格去掉
### example
```
mysql> SELECT ltrim(' ab d');
+------------------+
| ltrim(' ab d') |
+------------------+
| ab d |
+------------------+
mysql> SELECT ltrim(' ab d') str;
+------+
| str |
+------+
| ab d |
+------+
```
### keywords
LTRIM
LTRIM

View File

@ -58,4 +58,4 @@ mysql> select money_format(1123.4);
+----------------------+
```
### keywords
MONEY_FORMAT,MONEY,FORMAT
MONEY_FORMAT,MONEY,FORMAT

View File

@ -57,4 +57,4 @@ MySQL [(none)]> select null_or_empty("a");
+--------------------+
```
### keywords
NULL_OR_EMPTY
NULL_OR_EMPTY

View File

@ -0,0 +1,46 @@
---
{
"title": "parse_url",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## parse_url
### description
#### Syntax
`VARCHAR parse_url(VARCHAR url, VARCHAR name)`
在url解析出name对应的字段,name可选项为:'PROTOCOL', 'HOST', 'PATH', 'REF', 'AUTHORITY', 'FILE', 'USERINFO', 'PORT', 'QUERY',将结果返回。
```
mysql> SELECT parse_url ('https://doris.apache.org/', 'HOST');
+------------------------------------------------+
| parse_url('https://doris.apache.org/', 'HOST') |
+------------------------------------------------+
| doris.apache.org |
+------------------------------------------------+
```
### keywords
PARSE URL

View File

@ -53,4 +53,4 @@ mysql > select k1 from test where k1 not regexp 'ok$';
```
### keywords
REGEXP, NOT, NOT REGEXP
REGEXP, NOT, NOT REGEXP

View File

@ -53,4 +53,4 @@ mysql > select k1 from test where k1 regexp 'ok$';
```
### keywords
REGEXP
REGEXP

View File

@ -48,4 +48,4 @@ mysql> SELECT regexp_extract('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 2);
+-------------------------------------------------------------+
```
### keywords
REGEXP_EXTRACT,REGEXP,EXTRACT
REGEXP_EXTRACT,REGEXP,EXTRACT

View File

@ -51,4 +51,4 @@ mysql> SELECT regexp_replace('a b c','(b)','<\\1>');
+----------------------------------------+
```
### keywords
REGEXP_REPLACE,REGEXP,REPLACE
REGEXP_REPLACE,REGEXP,REPLACE

View File

@ -51,4 +51,4 @@ mysql> SELECT repeat("a", -1);
+-----------------+
```
### keywords
REPEAT,
REPEAT

View File

@ -43,4 +43,4 @@ mysql> select replace("http://www.baidu.com:9090", "9090", "");
+------------------------------------------------------+
```
### keywords
REPLACE
REPLACE

View File

@ -1,6 +1,6 @@
---
{
"title": "REVERSE",
"title": "reverse",
"language": "zh-CN"
}
---
@ -83,4 +83,4 @@ mysql> select k1, k2, reverse(k2) from array_test01 order by k1;
+------+-----------------------------------+-----------------------------------+
```
### keywords
REVERSE, ARRAY
REVERSE, ARRAY

View File

@ -44,4 +44,4 @@ mysql> select right("Hello doris",5);
+-------------------------+
```
### keywords
RIGHT
RIGHT

View File

@ -51,4 +51,4 @@ mysql> SELECT rpad("hi", 1, "xy");
+---------------------+
```
### keywords
RPAD
RPAD

View File

@ -0,0 +1,47 @@
---
{
"title": "rtrim",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## rtrim
### description
#### Syntax
`VARCHAR ltrim(VARCHAR str)`
将参数 str 中从右侧部分开始部分连续出现的空格去掉
### example
```
mysql> SELECT rtrim('ab d ') str;
+------+
| str |
+------+
| ab d |
+------+
```
### keywords
RTRIM

View File

@ -66,4 +66,4 @@ mysql> select split_part("abca", "a", 1);
+----------------------------+
```
### keywords
SPLIT_PART,SPLIT,PART
SPLIT_PART,SPLIT,PART

View File

@ -50,4 +50,4 @@ MySQL [(none)]> select starts_with("hello world","world");
+-------------------------------------+
```
### keywords
STARTS_WITH
STARTS_WITH

View File

@ -44,4 +44,4 @@ mysql> select strleft("Hello doris",5);
+------------------------+
```
### keywords
STRLEFT
STRLEFT

View File

@ -44,4 +44,4 @@ mysql> select strright("Hello doris",5);
+-------------------------+
```
### keywords
STRRIGHT
STRRIGHT

View File

@ -47,4 +47,4 @@ mysql> select substr("Hello doris", 1, 2);
+-----------------------------+
```
### keywords
SUBSTR
SUBSTR

View File

@ -76,4 +76,4 @@ mysql> select substring('abc1def', 2, 2);
+-----------------------------+
```
### keywords
SUBSTRING, STRING
SUBSTRING, STRING

View File

@ -0,0 +1,47 @@
---
{
"title": "trim",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## trim
### description
#### Syntax
`VARCHAR ltrim(VARCHAR str)`
将参数 str 中右侧和左侧开始部分连续出现的空格去掉
### example
```
mysql> SELECT trim(' ab d ') str;
+------+
| str |
+------+
| ab d |
+------+
```
### keywords
TRIM

View File

@ -0,0 +1,37 @@
---
{
"title": "ucase",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## ucase
### description
#### Syntax
`INT ucase(VARCHAR str)`
`upper`一致
### keywords
UCASE

View File

@ -60,4 +60,4 @@ mysql> select unhex('4142');
+---------------+
```
### keywords
UNHEX
UNHEX

View File

@ -0,0 +1,47 @@
---
{
"title": "upper",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## upper
### description
#### Syntax
`INT upper(VARCHAR str)`
将参数中所有的字符串都转换成大写
### example
```
mysql> SELECT upper("aBc123");
+-----------------+
| upper('aBc123') |
+-----------------+
| ABC123 |
+-----------------+
```
### keywords
UPPER