-- { echoOn } SELECT argMax((n, n), n) t, toTypeName(t) FROM (SELECT if(number >= 100, NULL, number) AS n from numbers(10)); (9,9) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMax((n, n), n) t, toTypeName(t) FROM (SELECT if(number <= 100, NULL, number) AS n from numbers(10)); (NULL,NULL) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMax((n, n), n) t, toTypeName(t) FROM (SELECT if(number % 3 = 0, NULL, number) AS n from numbers(10)); (8,8) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMax((n, n), n) t, toTypeName(t) FROM (SELECT if(number >= 100, NULL, number::Int32) AS n from numbers(10)); (9,9) Tuple(Nullable(Int32), Nullable(Int32)) SELECT argMax((n, n), n) t, toTypeName(t) FROM (SELECT if(number <= 100, NULL, number::Int32) AS n from numbers(10)); (NULL,NULL) Tuple(Nullable(Int32), Nullable(Int32)) SELECT argMax((n, n), n) t, toTypeName(t) FROM (SELECT if(number % 3 = 0, NULL, number::Int32) AS n from numbers(10)); (8,8) Tuple(Nullable(Int32), Nullable(Int32)) SELECT argMin((n, n), n) t, toTypeName(t) FROM (SELECT if(number >= 100, NULL, number) AS n from numbers(5, 10)); (5,5) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMin((n, n), n) t, toTypeName(t) FROM (SELECT if(number <= 100, NULL, number) AS n from numbers(5, 10)); (NULL,NULL) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMin((n, n), n) t, toTypeName(t) FROM (SELECT if(number % 5 == 0, NULL, number) as n from numbers(5, 10)); (6,6) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMin((n, n), n) t, toTypeName(t) FROM (SELECT if(number >= 100, NULL, number::Int32) AS n from numbers(5, 10)); (5,5) Tuple(Nullable(Int32), Nullable(Int32)) SELECT argMin((n, n), n) t, toTypeName(t) FROM (SELECT if(number <= 100, NULL, number::Int32) AS n from numbers(5, 10)); (NULL,NULL) Tuple(Nullable(Int32), Nullable(Int32)) SELECT argMin((n, n), n) t, toTypeName(t) FROM (SELECT if(number % 5 == 0, NULL, number::Int32) as n from numbers(5, 10)); (6,6) Tuple(Nullable(Int32), Nullable(Int32)) SELECT argMaxIf((n, n), n, n > 100) t, toTypeName(t) FROM (SELECT if(number % 3 = 0, NULL, number) AS n from numbers(50)); (NULL,NULL) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMaxIf((n, n), n, n < 100) t, toTypeName(t) FROM (SELECT if(number % 3 = 0, NULL, number) AS n from numbers(50)); (49,49) Tuple(Nullable(UInt64), Nullable(UInt64)) SELECT argMaxIf((n, n), n, n % 5 == 0) t, toTypeName(t) FROM (SELECT if(number % 3 = 0, NULL, number) AS n from numbers(50)); (40,40) Tuple(Nullable(UInt64), Nullable(UInt64))