ClickHouse/tests/queries/0_stateless/02884_string_hamming_distance.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
362 B
MySQL
Raw Normal View History

2023-09-22 17:43:52 +00:00
select hammingDistance('abcd', 'abcd');
drop table if exists t;
create table t
(
s1 String,
s2 String
) engine = MergeTree order by s1;
insert into t values ('abcdefg', 'abcdef') ('abcdefg', 'bcdefg') ('abcdefg', '');
select hammingDistance(s1, s2) from t;
select hammingDistance('abc', s2) from t;
select hammingDistance(s2, 'def') from t;
drop table t;