mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
22 lines
628 B
MySQL
22 lines
628 B
MySQL
|
SELECT toTypeName(sumArgMinState(number, number)) FROM numbers(1);
|
||
|
SELECT sumArgMinState(number, number) AS a FROM numbers(3) FORMAT Null;
|
||
|
|
||
|
DROP TABLE IF EXISTS argmax_comb;
|
||
|
CREATE TABLE argmax_comb(
|
||
|
id UInt64,
|
||
|
state AggregateFunction(avgArgMax, Float64, UInt64)
|
||
|
)
|
||
|
ENGINE=MergeTree() ORDER BY tuple();
|
||
|
INSERT INTO argmax_comb
|
||
|
SELECT
|
||
|
CAST(number % 10, 'UInt64') AS id,
|
||
|
avgArgMaxState(CAST(number, 'Float64'), id)
|
||
|
FROM numbers(100)
|
||
|
GROUP BY id;
|
||
|
SELECT avgArgMaxMerge(state) FROM argmax_comb;
|
||
|
SELECT
|
||
|
id,
|
||
|
avgArgMaxMerge(state)
|
||
|
FROM argmax_comb
|
||
|
GROUP BY id
|
||
|
ORDER BY id ASC;
|