[typo](docs)Optimized string and date function doc (#12949)
This commit is contained in:
@ -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
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> select ascii('234');
|
||||
+--------------+
|
||||
```
|
||||
### keywords
|
||||
ASCII
|
||||
ASCII
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> select bit_length("中国");
|
||||
+----------------------+
|
||||
```
|
||||
### keywords
|
||||
BIT_LENGTH
|
||||
BIT_LENGTH
|
||||
|
||||
@ -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
|
||||
|
||||
@ -58,4 +58,4 @@ mysql> select concat("a", null, "c");
|
||||
+------------------------+
|
||||
```
|
||||
### keywords
|
||||
CONCAT
|
||||
CONCAT
|
||||
|
||||
@ -82,4 +82,4 @@ mysql> select concat_ws("or", ["d", NULL,"is"]);
|
||||
+-----------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
CONCAT_WS,CONCAT,WS,ARRAY
|
||||
CONCAT_WS,CONCAT,WS,ARRAY
|
||||
|
||||
@ -59,4 +59,4 @@ mysql> select elt(2, 'aaa', 'bbb');
|
||||
+-----------------------+
|
||||
```
|
||||
### keywords
|
||||
ELT
|
||||
ELT
|
||||
|
||||
@ -50,4 +50,4 @@ mysql> select ends_with("Hello doris", "Hello");
|
||||
+-----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
ENDS_WITH
|
||||
ENDS_WITH
|
||||
|
||||
@ -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
|
||||
|
||||
@ -82,4 +82,4 @@ mysql> select hex(-1);
|
||||
+------------------+
|
||||
```
|
||||
### keywords
|
||||
HEX
|
||||
HEX
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> select instr("abc", "d");
|
||||
+-------------------+
|
||||
```
|
||||
### keywords
|
||||
INSTR
|
||||
INSTR
|
||||
|
||||
@ -34,4 +34,4 @@ under the License.
|
||||
与`lower`一致
|
||||
|
||||
### keywords
|
||||
LCASE
|
||||
LCASE
|
||||
|
||||
@ -44,4 +44,4 @@ mysql> select left("Hello doris",5);
|
||||
+------------------------+
|
||||
```
|
||||
### keywords
|
||||
LEFT
|
||||
LEFT
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> select length("中国");
|
||||
+------------------+
|
||||
```
|
||||
### keywords
|
||||
LENGTH
|
||||
LENGTH
|
||||
|
||||
@ -80,4 +80,4 @@ mysql > select k1 from test where k1 like 'a';
|
||||
```
|
||||
|
||||
### keywords
|
||||
LIKE
|
||||
LIKE
|
||||
|
||||
@ -82,4 +82,4 @@ mysql > select k1 from test where k1 not like 'a';
|
||||
```
|
||||
|
||||
### keywords
|
||||
LIKE, NOT, NOT LIKE
|
||||
LIKE, NOT, NOT LIKE
|
||||
|
||||
@ -58,4 +58,4 @@ mysql> SELECT LOCATE('bar', 'foobarbar', 5);
|
||||
+-------------------------------+
|
||||
```
|
||||
### keywords
|
||||
LOCATE
|
||||
LOCATE
|
||||
|
||||
@ -44,4 +44,4 @@ mysql> SELECT lower("AbC123");
|
||||
+-----------------+
|
||||
```
|
||||
### keywords
|
||||
LOWER
|
||||
LOWER
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> SELECT lpad("hi", 1, "xy");
|
||||
+---------------------+
|
||||
```
|
||||
### keywords
|
||||
LPAD
|
||||
LPAD
|
||||
|
||||
@ -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
|
||||
|
||||
@ -58,4 +58,4 @@ mysql> select money_format(1123.4);
|
||||
+----------------------+
|
||||
```
|
||||
### keywords
|
||||
MONEY_FORMAT,MONEY,FORMAT
|
||||
MONEY_FORMAT,MONEY,FORMAT
|
||||
|
||||
@ -57,4 +57,4 @@ MySQL [(none)]> select null_or_empty("a");
|
||||
+--------------------+
|
||||
```
|
||||
### keywords
|
||||
NULL_OR_EMPTY
|
||||
NULL_OR_EMPTY
|
||||
|
||||
@ -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
|
||||
@ -53,4 +53,4 @@ mysql > select k1 from test where k1 not regexp 'ok$';
|
||||
```
|
||||
|
||||
### keywords
|
||||
REGEXP, NOT, NOT REGEXP
|
||||
REGEXP, NOT, NOT REGEXP
|
||||
|
||||
@ -53,4 +53,4 @@ mysql > select k1 from test where k1 regexp 'ok$';
|
||||
```
|
||||
|
||||
### keywords
|
||||
REGEXP
|
||||
REGEXP
|
||||
|
||||
@ -48,4 +48,4 @@ mysql> SELECT regexp_extract('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 2);
|
||||
+-------------------------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
REGEXP_EXTRACT,REGEXP,EXTRACT
|
||||
REGEXP_EXTRACT,REGEXP,EXTRACT
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> SELECT regexp_replace('a b c','(b)','<\\1>');
|
||||
+----------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
REGEXP_REPLACE,REGEXP,REPLACE
|
||||
REGEXP_REPLACE,REGEXP,REPLACE
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> SELECT repeat("a", -1);
|
||||
+-----------------+
|
||||
```
|
||||
### keywords
|
||||
REPEAT,
|
||||
REPEAT
|
||||
|
||||
@ -43,4 +43,4 @@ mysql> select replace("http://www.baidu.com:9090", "9090", "");
|
||||
+------------------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
REPLACE
|
||||
REPLACE
|
||||
|
||||
@ -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
|
||||
|
||||
@ -44,4 +44,4 @@ mysql> select right("Hello doris",5);
|
||||
+-------------------------+
|
||||
```
|
||||
### keywords
|
||||
RIGHT
|
||||
RIGHT
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> SELECT rpad("hi", 1, "xy");
|
||||
+---------------------+
|
||||
```
|
||||
### keywords
|
||||
RPAD
|
||||
RPAD
|
||||
|
||||
@ -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
|
||||
@ -66,4 +66,4 @@ mysql> select split_part("abca", "a", 1);
|
||||
+----------------------------+
|
||||
```
|
||||
### keywords
|
||||
SPLIT_PART,SPLIT,PART
|
||||
SPLIT_PART,SPLIT,PART
|
||||
|
||||
@ -50,4 +50,4 @@ MySQL [(none)]> select starts_with("hello world","world");
|
||||
+-------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
STARTS_WITH
|
||||
STARTS_WITH
|
||||
|
||||
@ -44,4 +44,4 @@ mysql> select strleft("Hello doris",5);
|
||||
+------------------------+
|
||||
```
|
||||
### keywords
|
||||
STRLEFT
|
||||
STRLEFT
|
||||
|
||||
@ -44,4 +44,4 @@ mysql> select strright("Hello doris",5);
|
||||
+-------------------------+
|
||||
```
|
||||
### keywords
|
||||
STRRIGHT
|
||||
STRRIGHT
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select substr("Hello doris", 1, 2);
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
SUBSTR
|
||||
SUBSTR
|
||||
|
||||
@ -76,4 +76,4 @@ mysql> select substring('abc1def', 2, 2);
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
SUBSTRING, STRING
|
||||
SUBSTRING, STRING
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
@ -60,4 +60,4 @@ mysql> select unhex('4142');
|
||||
+---------------+
|
||||
```
|
||||
### keywords
|
||||
UNHEX
|
||||
UNHEX
|
||||
|
||||
@ -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
|
||||
Reference in New Issue
Block a user