Compute some stats in queries

This commit is contained in:
Raul Ochoa 2016-09-20 16:00:06 +02:00
parent c8d2f66467
commit 36b69a05e5

View File

@ -6,6 +6,9 @@ dot.templateSettings.strip = false;
function createTemplate(method) {
return dot.template([
'SELECT',
'min({{=it._column}}) min_val,',
'max({{=it._column}}) max_val,',
'avg({{=it._column}}) avg_val,',
method,
'FROM ({{=it._sql}}) _table_sql WHERE {{=it._column}} IS NOT NULL'
].join('\n'));