2018-12-05 16:59:35 +00:00
|
|
|
SET send_logs_level = 'none';
|
|
|
|
|
|
|
|
select lcase('FOO');
|
|
|
|
select ucase('foo');
|
|
|
|
select LOWER('Foo');
|
|
|
|
select UPPER('Foo');
|
2018-12-06 13:23:45 +00:00
|
|
|
select REPLACE('bar', 'r', 'z');
|
2018-12-06 13:36:23 +00:00
|
|
|
select Locate('foo', 'o');
|
2018-12-06 14:30:10 +00:00
|
|
|
select SUBSTRING('foo', 1, 2);
|
|
|
|
select Substr('foo', 2);
|
|
|
|
select mid('foo', 3);
|
2018-12-06 14:40:32 +00:00
|
|
|
select IF(3>2, 1, 0);
|
2018-12-10 12:54:02 +00:00
|
|
|
select substring('foo' from 1 + 1);
|
|
|
|
select SUBSTRING('foo' FROM 2 FOR 1);
|
2018-12-13 09:34:12 +00:00
|
|
|
select left('foo', 2);
|
2018-12-14 11:45:45 +00:00
|
|
|
select LEFT('foo', 123);
|
2018-12-13 09:34:12 +00:00
|
|
|
select RIGHT('bar', 1);
|
2018-12-14 11:45:45 +00:00
|
|
|
select right('bar', 123);
|
2018-12-17 20:20:25 +00:00
|
|
|
select ltrim('') || rtrim('') || trim('');
|
2018-12-13 11:50:37 +00:00
|
|
|
select ltrim(' foo');
|
|
|
|
select RTRIM(' foo ');
|
|
|
|
select trim(TRAILING 'x' FROM 'xxfooxx');
|
|
|
|
select Trim(LEADING 'ab' FROM 'abbafooabba');
|
|
|
|
select TRIM(both 'ab' FROM 'abbafooabbafooabba');
|
2018-12-13 12:58:00 +00:00
|
|
|
select trim(LEADING '*[]{}|\\' FROM '\\|[[[}}}*foo*');
|
2018-12-18 14:40:30 +00:00
|
|
|
select DATE_DIFF(MONTH, toDate('2018-12-18'), toDate('2018-01-01'));
|
2018-12-18 15:28:13 +00:00
|
|
|
select DATE_DIFF(QQ, toDate('2018-12-18'), toDate('2018-01-01'));
|
2018-12-19 11:37:14 +00:00
|
|
|
select DATE_ADD(YEAR, 3, toDate('2018-01-01'));
|
|
|
|
select timestamp_sub(SQL_TSI_MONTH, 5, toDateTime('2018-12-18 01:02:03'));
|
2018-12-20 08:22:24 +00:00
|
|
|
select timestamp_ADD(toDate('2018-01-01'), INTERVAL 3 MONTH);
|