[typo](docs)Optimized string and date function doc (#12949)
This commit is contained in:
@ -66,4 +66,4 @@ Note:
|
||||
2. Limited by the JDK implementation, if you use jdk8 to build FE, the precision can be up to milliseconds (three decimal places), and the larger precision bits will be filled with 0. If you need higher accuracy, please use jdk11 to build FE.
|
||||
|
||||
### keywords
|
||||
CURRENT_TIMESTAMP,CURRENT,TIMESTAMP
|
||||
CURRENT_TIMESTAMP,CURRENT,TIMESTAMP
|
||||
|
||||
@ -50,4 +50,4 @@ mysql> select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY);
|
||||
+-------------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DATE_ADD,DATE,ADD
|
||||
DATE_ADD,DATE,ADD
|
||||
|
||||
@ -163,4 +163,4 @@ mysql> select date_format('2006-06-01', '%%%d');
|
||||
+--------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DATE_FORMAT,DATE,FORMAT
|
||||
DATE_FORMAT,DATE,FORMAT
|
||||
|
||||
@ -50,4 +50,4 @@ mysql> select date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY);
|
||||
+-------------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
Date, date, date
|
||||
Date, date, date
|
||||
|
||||
@ -56,4 +56,4 @@ mysql> select datediff(CAST('2010-11-30 23:59:59' AS DATETIME), CAST('2010-12-31
|
||||
+-----------------------------------------------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DATEDIFF
|
||||
DATEDIFF
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select day('1987-01-31');
|
||||
+----------------------------+
|
||||
```
|
||||
### keywords
|
||||
DAY
|
||||
DAY
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select dayname('2007-02-03 00:00:00');
|
||||
+--------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DAYNAME
|
||||
DAYNAME
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select dayofmonth('1987-01-31');
|
||||
+-----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DAYOFMONTH
|
||||
DAYOFMONTH
|
||||
|
||||
@ -52,4 +52,4 @@ mysql> select dayofweek(cast(20190625 as date));
|
||||
+-----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DAYOFWEEK
|
||||
DAYOFWEEK
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select dayofyear('2007-02-03 00:00:00');
|
||||
+----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
DAYOFYEAR
|
||||
DAYOFYEAR
|
||||
|
||||
@ -42,5 +42,7 @@ mysql > select from u days (730669);
|
||||
+-------------------+
|
||||
| 2000-07-03 |
|
||||
+-------------------+
|
||||
```
|
||||
|
||||
### keywords
|
||||
FROM_DAYS,FROM,DAYS
|
||||
FROM_DAYS,FROM,DAYS
|
||||
|
||||
@ -61,6 +61,7 @@ mysql> select from_unixtime(1196440219, '%Y-%m-%d %H:%i:%s');
|
||||
+--------------------------------------------------+
|
||||
| 2007-12-01 00:30:19 |
|
||||
+--------------------------------------------------+
|
||||
```
|
||||
|
||||
### keywords
|
||||
|
||||
|
||||
@ -45,4 +45,4 @@ mysql> select hour('2018-12-31 23:59:59');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
HOUR
|
||||
HOUR
|
||||
|
||||
@ -42,4 +42,4 @@ mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400);
|
||||
+-------------------+---------------------+---------------------+
|
||||
```
|
||||
### keywords
|
||||
MAKEDATE
|
||||
MAKEDATE
|
||||
|
||||
@ -45,4 +45,4 @@ mysql> select minute('2018-12-31 23:59:59');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
MINUTE
|
||||
MINUTE
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select month('1987-01-01');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
MONTH
|
||||
MONTH
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select monthname('2008-02-03 00:00:00');
|
||||
+----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
MONTHNAME
|
||||
MONTHNAME
|
||||
|
||||
@ -66,4 +66,4 @@ Note:
|
||||
2. Limited by the JDK implementation, if you use jdk8 to build FE, the precision can be up to milliseconds (three decimal places), and the larger precision bits will be filled with 0. If you need higher accuracy, please use jdk11 to build FE.
|
||||
|
||||
### keywords
|
||||
NOW
|
||||
NOW
|
||||
|
||||
@ -45,4 +45,4 @@ mysql> select second('2018-12-31 23:59:59');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
SECOND
|
||||
SECOND
|
||||
|
||||
@ -83,4 +83,4 @@ MySQL> SELECT MONTH_CEIL(CAST('2020-02-02 13:09:20' AS DATETIME), 3, CAST('1970-
|
||||
|
||||
```
|
||||
### keywords
|
||||
TIME_ROUND
|
||||
TIME_ROUND
|
||||
|
||||
@ -62,4 +62,4 @@ mysql> SELECT TIMEDIFF('2019-01-01 00:00:00', NULL);
|
||||
+---------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
TIMEDIFF
|
||||
TIMEDIFF
|
||||
|
||||
@ -55,4 +55,4 @@ mysql> SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
|
||||
+----------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
TIMESTAMPADD
|
||||
TIMESTAMPADD
|
||||
|
||||
@ -64,4 +64,4 @@ MySQL> SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55');
|
||||
|
||||
```
|
||||
### keywords
|
||||
TIMESTAMPDIFF
|
||||
TIMESTAMPDIFF
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select to_days('2007-10-07');
|
||||
```
|
||||
|
||||
### keywords
|
||||
TO_DAYS,TO,DAYS
|
||||
TO_DAYS,TO,DAYS
|
||||
|
||||
@ -46,5 +46,6 @@ mysql> select utc_timestamp(),utc_timestamp() + 1;
|
||||
+---------------------+---------------------+
|
||||
| 2019-07-10 12:31:18 | 20190710123119 |
|
||||
+---------------------+---------------------+
|
||||
```
|
||||
### keywords
|
||||
UTC_TIMESTAMP,UTC,TIMESTAMP
|
||||
UTC_TIMESTAMP,UTC,TIMESTAMP
|
||||
|
||||
@ -64,4 +64,4 @@ mysql> select week('2020-7-1',1);
|
||||
+---------------------+
|
||||
```
|
||||
### keywords
|
||||
WEEK
|
||||
WEEK
|
||||
|
||||
@ -63,4 +63,4 @@ mysql> select weekday(cast(20190625 as date));
|
||||
+---------------------------------+
|
||||
```
|
||||
### keywords
|
||||
WEEKDAY
|
||||
WEEKDAY
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select weekofyear('2008-02-20 00:00:00');
|
||||
+-----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
WEEKOFYEAR
|
||||
WEEKOFYEAR
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select year('1987-01-01');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
YEAR
|
||||
YEAR
|
||||
|
||||
@ -36,6 +36,7 @@ When the week of the date belongs to the previous year, the year and week of the
|
||||
when the week of the date belongs to the next year, the year of the next year is returned and the week is 1.
|
||||
|
||||
The following table describes how the mode argument works.
|
||||
|
||||
|Mode |First day of week |Range |Week 1 is the first week … |
|
||||
|:----|:-----------------|:-------|:-----------------------------|
|
||||
|0 |Sunday |1-53 |with a Sunday in this year |
|
||||
@ -76,4 +77,4 @@ mysql> select yearweek('2024-12-30',1);
|
||||
```
|
||||
|
||||
### keywords
|
||||
YEARWEEK
|
||||
YEARWEEK
|
||||
|
||||
@ -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
|
||||
|
||||
@ -52,4 +52,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
|
||||
|
||||
@ -51,4 +51,4 @@ mysql> select ends_with("Hello doris", "Hello");
|
||||
+-----------------------------------+
|
||||
```
|
||||
### keywords
|
||||
ENDS_WITH
|
||||
ENDS_WITH
|
||||
|
||||
@ -46,4 +46,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.
|
||||
Consistent with `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
|
||||
|
||||
@ -44,4 +44,4 @@ mysql> SELECT ltrim(' 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,48 @@
|
||||
---
|
||||
{
|
||||
"title": "parse_url",
|
||||
"language": "en"
|
||||
}
|
||||
---
|
||||
|
||||
<!--
|
||||
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)`
|
||||
|
||||
|
||||
From the URL, the field corresponding to name is resolved. The name options are as follows: 'PROTOCOL', 'HOST', 'PATH', 'REF', 'AUTHORITY', 'FILE', 'USERINFO', 'PORT', 'QUERY', and the result is returned.
|
||||
|
||||
### example
|
||||
|
||||
```
|
||||
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
|
||||
|
||||
@ -51,4 +51,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
|
||||
|
||||
@ -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": "en"
|
||||
}
|
||||
---
|
||||
|
||||
<!--
|
||||
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)`
|
||||
|
||||
|
||||
Remove the space that appears continuously from the ending of the parameter 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
|
||||
|
||||
@ -51,4 +51,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
|
||||
|
||||
@ -45,4 +45,4 @@ mysql> select strright("Hello doris",5);
|
||||
+-------------------------+
|
||||
```
|
||||
### keywords
|
||||
STRRIGHT
|
||||
STRRIGHT
|
||||
|
||||
@ -47,4 +47,4 @@ mysql> select substr("Hello doris", 1, 2);
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
SUBSTR
|
||||
SUBSTR
|
||||
|
||||
@ -82,4 +82,4 @@ mysql> select substring('abc1def', 2, 2);
|
||||
```
|
||||
|
||||
### keywords
|
||||
SUBSTRING, STRING
|
||||
SUBSTRING, STRING
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
---
|
||||
{
|
||||
"title": "trim",
|
||||
"language": "en"
|
||||
}
|
||||
---
|
||||
|
||||
<!--
|
||||
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)`
|
||||
|
||||
|
||||
Remove the space that appears continuously from the starring and ending of the parameter str
|
||||
|
||||
### example
|
||||
|
||||
```
|
||||
mysql> SELECT trim(' ab d ') str;
|
||||
+------+
|
||||
| str |
|
||||
+------+
|
||||
| ab d |
|
||||
+------+
|
||||
```
|
||||
### keywords
|
||||
TRIM
|
||||
@ -0,0 +1,37 @@
|
||||
---
|
||||
{
|
||||
"title": "ucase",
|
||||
"language": "en"
|
||||
}
|
||||
---
|
||||
|
||||
<!--
|
||||
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)`
|
||||
|
||||
|
||||
Consistent with `upper`.
|
||||
|
||||
### keywords
|
||||
UCASE
|
||||
@ -60,4 +60,4 @@ mysql> select unhex('4142');
|
||||
+---------------+
|
||||
```
|
||||
### keywords
|
||||
UNHEX
|
||||
UNHEX
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
---
|
||||
{
|
||||
"title": "upper",
|
||||
"language": "en"
|
||||
}
|
||||
---
|
||||
|
||||
<!--
|
||||
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)`
|
||||
|
||||
|
||||
Convert all strings in parameters to uppercase
|
||||
|
||||
### example
|
||||
|
||||
```
|
||||
mysql> SELECT upper("aBc123");
|
||||
+-----------------+
|
||||
| upper('aBc123') |
|
||||
+-----------------+
|
||||
| ABC123 |
|
||||
+-----------------+
|
||||
```
|
||||
### keywords
|
||||
UPPER
|
||||
@ -346,37 +346,43 @@
|
||||
"type": "category",
|
||||
"label": "String Functions",
|
||||
"items": [
|
||||
"sql-manual/sql-functions/string-functions/concat_ws",
|
||||
"sql-manual/sql-functions/string-functions/hex",
|
||||
"sql-manual/sql-functions/string-functions/lower",
|
||||
"sql-manual/sql-functions/string-functions/lpad",
|
||||
"sql-manual/sql-functions/string-functions/substring",
|
||||
"sql-manual/sql-functions/string-functions/instr",
|
||||
"sql-manual/sql-functions/string-functions/repeat",
|
||||
"sql-manual/sql-functions/string-functions/lcase",
|
||||
"sql-manual/sql-functions/string-functions/replace",
|
||||
"sql-manual/sql-functions/string-functions/rpad",
|
||||
"sql-manual/sql-functions/string-functions/split_part",
|
||||
"sql-manual/sql-functions/string-functions/append_trailing_char_if_absent",
|
||||
"sql-manual/sql-functions/string-functions/ltrim",
|
||||
"sql-manual/sql-functions/string-functions/left",
|
||||
"sql-manual/sql-functions/string-functions/starts_with",
|
||||
"sql-manual/sql-functions/string-functions/concat",
|
||||
"sql-manual/sql-functions/string-functions/ascii",
|
||||
"sql-manual/sql-functions/string-functions/length",
|
||||
"sql-manual/sql-functions/string-functions/bit_length",
|
||||
"sql-manual/sql-functions/string-functions/char_length",
|
||||
"sql-manual/sql-functions/string-functions/lpad",
|
||||
"sql-manual/sql-functions/string-functions/rpad",
|
||||
"sql-manual/sql-functions/string-functions/lower",
|
||||
"sql-manual/sql-functions/string-functions/lcase",
|
||||
"sql-manual/sql-functions/string-functions/upper",
|
||||
"sql-manual/sql-functions/string-functions/ucase",
|
||||
"sql-manual/sql-functions/string-functions/repeat",
|
||||
"sql-manual/sql-functions/string-functions/reverse",
|
||||
"sql-manual/sql-functions/string-functions/concat",
|
||||
"sql-manual/sql-functions/string-functions/concat_ws",
|
||||
"sql-manual/sql-functions/string-functions/substr",
|
||||
"sql-manual/sql-functions/string-functions/substring",
|
||||
"sql-manual/sql-functions/string-functions/append_trailing_char_if_absent",
|
||||
"sql-manual/sql-functions/string-functions/ends_with",
|
||||
"sql-manual/sql-functions/string-functions/starts_with",
|
||||
"sql-manual/sql-functions/string-functions/trim",
|
||||
"sql-manual/sql-functions/string-functions/ltrim",
|
||||
"sql-manual/sql-functions/string-functions/rtrim",
|
||||
"sql-manual/sql-functions/string-functions/null_or_empty",
|
||||
"sql-manual/sql-functions/string-functions/hex",
|
||||
"sql-manual/sql-functions/string-functions/unhex",
|
||||
"sql-manual/sql-functions/string-functions/elt",
|
||||
"sql-manual/sql-functions/string-functions/instr",
|
||||
"sql-manual/sql-functions/string-functions/locate",
|
||||
"sql-manual/sql-functions/string-functions/find_in_set",
|
||||
"sql-manual/sql-functions/string-functions/replace",
|
||||
"sql-manual/sql-functions/string-functions/left",
|
||||
"sql-manual/sql-functions/string-functions/right",
|
||||
"sql-manual/sql-functions/string-functions/strleft",
|
||||
"sql-manual/sql-functions/string-functions/strright",
|
||||
"sql-manual/sql-functions/string-functions/split_part",
|
||||
"sql-manual/sql-functions/string-functions/money_format",
|
||||
"sql-manual/sql-functions/string-functions/right",
|
||||
"sql-manual/sql-functions/string-functions/substr",
|
||||
"sql-manual/sql-functions/string-functions/find_in_set",
|
||||
"sql-manual/sql-functions/string-functions/ascii",
|
||||
"sql-manual/sql-functions/string-functions/reverse",
|
||||
"sql-manual/sql-functions/string-functions/length",
|
||||
"sql-manual/sql-functions/string-functions/unhex",
|
||||
"sql-manual/sql-functions/string-functions/ends_with",
|
||||
"sql-manual/sql-functions/string-functions/char_length",
|
||||
"sql-manual/sql-functions/string-functions/null_or_empty",
|
||||
"sql-manual/sql-functions/string-functions/locate",
|
||||
"sql-manual/sql-functions/string-functions/parse_url",
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Fuzzy Match",
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select day('1987-01-31');
|
||||
+----------------------------+
|
||||
```
|
||||
### keywords
|
||||
DAY
|
||||
DAY
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select hour('2018-12-31 23:59:59');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
HOUR
|
||||
HOUR
|
||||
|
||||
@ -29,6 +29,7 @@ under the License.
|
||||
#### Syntax
|
||||
|
||||
`DATE MAKEDATE(INT year, INT dayofyear)`
|
||||
|
||||
返回指定年份和dayofyear构建的日期。dayofyear必须大于0,否则结果为空。
|
||||
|
||||
### example
|
||||
@ -43,4 +44,4 @@ mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400);
|
||||
|
||||
### keywords
|
||||
|
||||
YEARWEEK
|
||||
MAKEDATE
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select minute('2018-12-31 23:59:59');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
MINUTE
|
||||
MINUTE
|
||||
|
||||
@ -46,4 +46,4 @@ mysql> select second('2018-12-31 23:59:59');
|
||||
+-----------------------------+
|
||||
```
|
||||
### keywords
|
||||
SECOND
|
||||
SECOND
|
||||
|
||||
@ -83,4 +83,4 @@ MySQL> SELECT MONTH_CEIL(CAST('2020-02-02 13:09:20' AS DATETIME), 3, CAST('1970-
|
||||
|
||||
```
|
||||
### keywords
|
||||
TIME_ROUND
|
||||
TIME_ROUND
|
||||
|
||||
@ -56,4 +56,4 @@ mysql> SELECT TIMESTAMPADD(WEEK,1,'2019-01-02');
|
||||
+----------------------------------------------+
|
||||
```
|
||||
### keywords
|
||||
TIMESTAMPADD
|
||||
TIMESTAMPADD
|
||||
|
||||
@ -64,4 +64,4 @@ MySQL> SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55');
|
||||
|
||||
```
|
||||
### keywords
|
||||
TIMESTAMPDIFF
|
||||
TIMESTAMPDIFF
|
||||
|
||||
@ -65,4 +65,4 @@ mysql> select weekday(cast(20190625 as date));
|
||||
```
|
||||
|
||||
### keywords
|
||||
WEEKDAY
|
||||
WEEKDAY
|
||||
|
||||
@ -35,6 +35,7 @@ under the License.
|
||||
当日期所在的星期属于上一年时,返回的是上一年的年份和星期数;
|
||||
当日期所在的星期属于下一年时,返回的是下一年的年份,星期数为1。
|
||||
参数mode的作用参见下面的表格:
|
||||
|
||||
|Mode |星期的第一天 |星期数的范围 |第一个星期的定义 |
|
||||
|:----|:------------|:------------|:--------------------------------------------|
|
||||
|0 |星期日 |1-53 |这一年中的第一个星期日所在的星期 |
|
||||
|
||||
@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user