Bug 6466 - Mode measure
Summary: Mode measure
Status: NEW
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: 11.25.23 (Dec2016-SP5)
Hardware: Other Windows
: Normal enhancement
Assignee: SQL devs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-13 17:34 CET by Manuel
Modified: 2017-11-13 17:34 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel 2017-11-13 17:34:34 CET
User-Agent:       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Build Identifier: 

It would be nice to have the MODE of a field as a native measure, so that one
will be able to do queries like

SELECT MODE(X), MEDIAN(Y) .... from ... group by ....



Reproducible: Always



Expected Results:  
MODE(X) would return the equivalent of 

select "X" from (select "X", count(1) as "count" from "T0" group by "X") as "T1" order by "count" desc limit 1;

but with the advantage of being able to specify other measures in the same query, and more importantly, being able to use the query with the mode function as a sub-query