ClickHouse/tests/queries/0_stateless/02798_substring_index.reference
2023-06-28 10:45:52 +08:00

156 lines
7.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- { echoOn }
select substringIndex('www.clickhouse.com', '.', -4);
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', -3);
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', -2);
clickhouse.com
select substringIndex('www.clickhouse.com', '.', -1);
com
select substringIndex('www.clickhouse.com', '.', 0);
select substringIndex('www.clickhouse.com', '.', 1);
www
select substringIndex('www.clickhouse.com', '.', 2);
www.clickhouse
select substringIndex('www.clickhouse.com', '.', 3);
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', 4);
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', -4);
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', -3);
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', -2);
clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', -1);
com
select substringIndex(materialize('www.clickhouse.com'), '.', 0);
select substringIndex(materialize('www.clickhouse.com'), '.', 1);
www
select substringIndex(materialize('www.clickhouse.com'), '.', 2);
www.clickhouse
select substringIndex(materialize('www.clickhouse.com'), '.', 3);
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', 4);
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(-4));
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(-3));
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(-2));
clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(-1));
com
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(0));
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(1));
www
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(2));
www.clickhouse
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(3));
www.clickhouse.com
select substringIndex(materialize('www.clickhouse.com'), '.', materialize(4));
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', materialize(-4));
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', materialize(-3));
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', materialize(-2));
clickhouse.com
select substringIndex('www.clickhouse.com', '.', materialize(-1));
com
select substringIndex('www.clickhouse.com', '.', materialize(0));
select substringIndex('www.clickhouse.com', '.', materialize(1));
www
select substringIndex('www.clickhouse.com', '.', materialize(2));
www.clickhouse
select substringIndex('www.clickhouse.com', '.', materialize(3));
www.clickhouse.com
select substringIndex('www.clickhouse.com', '.', materialize(4));
www.clickhouse.com
select SUBSTRING_INDEX('www.clickhouse.com', '.', 2);
www.clickhouse
select substringIndex('www.clickhouse.com', '..', 2); -- { serverError BAD_ARGUMENTS }
select substringIndex('www.clickhouse.com', '', 2); -- { serverError BAD_ARGUMENTS }
select substringIndex('www.clickhouse.com', materialize('.'), 2); -- { serverError ILLEGAL_COLUMN }
select substringIndex('www.clickhouse.com', '.', cast(2 as Int128)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
select substringIndexUTF8('富强,民主,文明', '', -4);
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', -3);
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', -2);
民主,文明
select substringIndexUTF8('富强,民主,文明', '', -1);
文明
select substringIndexUTF8('富强,民主,文明', '', 0);
select substringIndexUTF8('富强,民主,文明', '', 1);
富强
select substringIndexUTF8('富强,民主,文明', '', 2);
富强,民主
select substringIndexUTF8('富强,民主,文明', '', 3);
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', 4);
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', -4);
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', -3);
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', -2);
民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', -1);
文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', 0);
select substringIndexUTF8(materialize('富强,民主,文明'), '', 1);
富强
select substringIndexUTF8(materialize('富强,民主,文明'), '', 2);
富强,民主
select substringIndexUTF8(materialize('富强,民主,文明'), '', 3);
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', 4);
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', materialize(-4));
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', materialize(-3));
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', materialize(-2));
民主,文明
select substringIndexUTF8('富强,民主,文明', '', materialize(-1));
文明
select substringIndexUTF8('富强,民主,文明', '', materialize(0));
select substringIndexUTF8('富强,民主,文明', '', materialize(1));
富强
select substringIndexUTF8('富强,民主,文明', '', materialize(2));
富强,民主
select substringIndexUTF8('富强,民主,文明', '', materialize(3));
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', materialize(4));
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(-4));
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(-3));
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(-2));
民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(-1));
文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(0));
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(1));
富强
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(2));
富强,民主
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(3));
富强,民主,文明
select substringIndexUTF8(materialize('富强,民主,文明'), '', materialize(4));
富强,民主,文明
select substringIndexUTF8('富强,民主,文明', '', 2); -- { serverError BAD_ARGUMENTS }
select substringIndexUTF8('富强,民主,文明', '', 2); -- { serverError BAD_ARGUMENTS }
select substringIndexUTF8('富强,民主,文明', materialize(''), 2); -- { serverError ILLEGAL_COLUMN }
select substringIndexUTF8('富强,民主,文明', '', cast(2 as Int128)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }