mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-05 23:31:24 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
25 lines
712 B
SQL
25 lines
712 B
SQL
DROP TABLE IF EXISTS replaceall;
|
|
CREATE TABLE replaceall (str FixedString(3)) ENGINE = Memory;
|
|
|
|
INSERT INTO replaceall VALUES ('foo');
|
|
INSERT INTO replaceall VALUES ('boa');
|
|
INSERT INTO replaceall VALUES ('bar');
|
|
INSERT INTO replaceall VALUES ('bao');
|
|
|
|
SELECT
|
|
str,
|
|
replaceAll(str, 'o', '*') AS replaced
|
|
FROM replaceall
|
|
ORDER BY str ASC;
|
|
|
|
DROP TABLE replaceall;
|
|
|
|
CREATE TABLE replaceall (date Date DEFAULT today(), fs FixedString(16)) ENGINE = MergeTree(date, (date, fs), 8192);
|
|
INSERT INTO replaceall (fs) VALUES ('54db0d43009d\0\0\0\0'), ('fe2b58224766cf10'), ('54db0d43009d\0\0\0\0'), ('fe2b58224766cf10');
|
|
|
|
SELECT fs, replaceAll(fs, '\0', '*')
|
|
FROM replaceall
|
|
ORDER BY fs ASC;
|
|
|
|
DROP TABLE replaceall;
|