mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
17 lines
800 B
SQL
17 lines
800 B
SQL
SELECT 'aaaabb ' == trim(leading 'b ' FROM 'b aaaabb ') x;
|
|
SELECT 'b aaaa' == trim(trailing 'b ' FROM 'b aaaabb ') x;
|
|
SELECT 'aaaa' == trim(both 'b ' FROM 'b aaaabb ') x;
|
|
|
|
SELECT '1' == replaceRegexpAll(',,1,,', '^[,]*|[,]*$', '') x;
|
|
SELECT '1' == replaceRegexpAll(',,1', '^[,]*|[,]*$', '') x;
|
|
SELECT '1' == replaceRegexpAll('1,,', '^[,]*|[,]*$', '') x;
|
|
|
|
SELECT '1,,' == replaceRegexpOne(',,1,,', '^[,]*|[,]*$', '') x;
|
|
SELECT '1' == replaceRegexpOne(',,1', '^[,]*|[,]*$', '') x;
|
|
SELECT '1,,' == replaceRegexpOne('1,,', '^[,]*|[,]*$', '') x;
|
|
|
|
SELECT '5935,5998,6014' == trim(BOTH ', ' FROM '5935,5998,6014, ') x;
|
|
SELECT '5935,5998,6014' == replaceRegexpAll('5935,5998,6014, ', concat('^[', regexpQuoteMeta(', '), ']*|[', regexpQuoteMeta(', '), ']*$'), '') AS x;
|
|
|
|
SELECT trim(BOTH '"' FROM '2') == '2'
|