### Is your feature request related to a problem or challenge? The most frequent value. ### Describe the solution you'd like ```sql D SELECT mode(col) FROM VALUES ([1, 2]), ([1, 2]), ([2, 3]) AS tab(col); ┌───────────┐ │ mode(col) │ │ varchar │ ├───────────┤ │ [1, 2] │ └───────────┘ -- The function returns either 1 or 2, but not 3 > SELECT mode(col) FROM VALUES (1), (1), (2), (2), (3) AS tab(col); 1 > SELECT mode(col) FROM VALUES (NULL), (NULL) AS tab(col); NULL ``` ### Describe alternatives you've considered _No response_ ### Additional context https://duckdb.org/docs/sql/functions/aggregates#modex https://docs.databricks.com/en/sql/language-manual/functions/mode.html
Activity
s5dsn-eqee commentedon Aug 30, 2024
take
s5dsn-eqee commentedon Sep 7, 2024
Done for primitive/float types, working on bytes/views.
alamb commentedon Sep 9, 2024
Given #12357 we may want to move this function to some other repo rather than the core
alamb commentedon Sep 16, 2024
Suggestion: #12254 (comment)
s5dsn-eqee commentedon Sep 23, 2024
Implemented: mode.rs
alamb commentedon Sep 25, 2024
We are going to implement these in a different repository so closing this ticket to avoid confusion: #12254 (comment)