-
Notifications
You must be signed in to change notification settings - Fork 664
MIN
Mathias Rangel Wulff edited this page Jul 22, 2016
·
5 revisions
Minimal aggregator and function.
Syntax:
MIN([DISTINCT] expression) -- aggregator
MIN(expression1, expression2, ...) -- function
'null' will be treated as 0
so if you have unclean data its suggested that you make your own aggregation with user defined functions:
alasql.aggr.LEAST = function(v,s,stage){
if(stage == 1) return v;
if(stage == 2) {
if(v == null) return s;
else return Math.min(s,v);;
}
return s;
};
var res = alasql('SELECT LEAST(a) FROM ?',[data])
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo