mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
15 lines
761 B
SQL
15 lines
761 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;
|