ClickHouse/tests/queries/0_stateless/00027_argMinMax.sql

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

17 lines
681 B
MySQL
Raw Normal View History

2021-04-20 21:58:33 +00:00
-- types
2021-04-22 01:27:27 +00:00
select argMin(x.1, x.2), argMax(x.1, x.2) from (select (number, number + 1) as x from numbers(10));
select argMin(x.1, x.2), argMax(x.1, x.2) from (select (toString(number), toInt32(number) + 1) as x from numbers(10));
select argMin(x.1, x.2), argMax(x.1, x.2) from (select (toDate(number, 'UTC'), toDateTime(number, 'UTC') + 1) as x from numbers(10));
select argMin(x.1, x.2), argMax(x.1, x.2) from (select (toDecimal32(number, 2), toDecimal64(number, 2) + 1) as x from numbers(10));
2021-04-20 21:58:33 +00:00
-- array
2024-01-17 17:09:42 +00:00
SELECT
argMinArray(id, num),
argMaxArray(id, num)
FROM
(
SELECT
arrayJoin([[10, 4, 3], [7, 5, 6], [8, 8, 2]]) AS num,
arrayJoin([[1, 2, 4]]) AS id
)