mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
24 lines
1012 B
SQL
24 lines
1012 B
SQL
-- const tuple argument
|
|
|
|
SELECT tupleElement(('hello', 'world'), 1, 'default');
|
|
SELECT tupleElement(('hello', 'world'), 2, 'default');
|
|
SELECT tupleElement(('hello', 'world'), 3, 'default');
|
|
SELECT tupleElement(('hello', 'world'), 'xyz', 'default');
|
|
SELECT tupleElement(('hello', 'world'), 3, [([('a')], 1)]); -- arbitrary default value
|
|
|
|
SELECT tupleElement([(1, 2), (3, 4)], 1, 'default');
|
|
SELECT tupleElement([(1, 2), (3, 4)], 2, 'default');
|
|
SELECT tupleElement([(1, 2), (3, 4)], 3, 'default');
|
|
|
|
SELECT '--------';
|
|
|
|
-- non-const tuple argument
|
|
|
|
SELECT tupleElement(materialize(('hello', 'world')), 1, 'default');
|
|
SELECT tupleElement(materialize(('hello', 'world')), 2, 'default');
|
|
SELECT tupleElement(materialize(('hello', 'world')), 3, 'default');
|
|
SELECT tupleElement(materialize(('hello', 'world')), 'xzy', 'default');
|
|
SELECT tupleElement(materialize(('hello', 'world')), 'xzy', [([('a')], 1)]); -- arbitrary default value
|
|
|
|
SELECT tupleElement([[(count('2147483646'), 1)]], 'aaaa', [[1, 2, 3]]) -- bug #51525
|