Samples
Find the top 5 values fromi * 13 % 10007 for i = 1 to 10000.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Returns an array of the highest values from a MaxN aggregate
i * 13 % 10007 for i = 1 to 10000.
SELECT into_array(
max_n(sub.val, 5))
FROM (
SELECT (i * 13) % 10007 AS val
FROM generate_series(1,10000) as i
) sub;
into_array
---------------------------------
{10006,10005,10004,10003,10002}
into_array (
agg MaxN
) BIGINT[] | DOUBLE PRECISION[] | TIMESTAMPTZ[]
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
agg | MaxN | - | ✔ | The aggregate to return the results from. Note that the exact type here varies based on the type of data stored in the aggregate. |
| Column | Type | Description |
|---|---|---|
| into_array | BIGINT[ ] | DOUBLE PRECISION[ ] | TIMESTAMPTZ[ ] | The highest values seen while creating this aggregate. |