2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS replaceall;
|
|
|
|
CREATE TABLE replaceall (str FixedString(3)) ENGINE = Memory;
|
2016-12-02 23:29:16 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO replaceall VALUES ('foo');
|
|
|
|
INSERT INTO replaceall VALUES ('boa');
|
|
|
|
INSERT INTO replaceall VALUES ('bar');
|
|
|
|
INSERT INTO replaceall VALUES ('bao');
|
2016-12-02 23:29:16 +00:00
|
|
|
|
|
|
|
SELECT
|
|
|
|
str,
|
|
|
|
replaceAll(str, 'o', '*') AS replaced
|
2019-04-16 14:13:13 +00:00
|
|
|
FROM replaceall
|
2016-12-02 23:29:16 +00:00
|
|
|
ORDER BY str ASC;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE replaceall;
|
2017-04-18 13:25:50 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
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');
|
2017-04-18 13:25:50 +00:00
|
|
|
|
|
|
|
SELECT fs, replaceAll(fs, '\0', '*')
|
2019-04-16 14:13:13 +00:00
|
|
|
FROM replaceall
|
2017-04-18 13:25:50 +00:00
|
|
|
ORDER BY fs ASC;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE replaceall;
|