Hi Feng,

Hmm... it is doable I think, but not a common case.


Francis Liang <[email protected]> 于2018年9月28日周五 下午5:50写道:

> Hi guys:
>
>
>
> As all know, TOP_N expression can be used in the following scenario:
>
>
>
> Select dim_a, sum(metric_a) sum_metric_a from table group by dim_a order
> by sum_metric_a desc limit 100
>
>
>
> However, can we sort one metric but aggregate other metrics at the same
> time, like the following scenario:
>
>
>
> Select dim_a, sum(metric_a) sum_metric_a,  sum(metric_b) sum_metric_b,
> sum(metric_c) sum_metric_c from table group by dim_a order by sum_metric_a
> desc limit 100
>
>
>
> Of course it can be done by just using the normal expression and sort it
> online during query process, but can it be done as a pre-calculation, just
> like the TOP_N? Hope this makes sense.
>
>
>
> Thanks guys!
>
>
>
> Best, Feng
>
>
>
> 发送自 Windows 10 版邮件 <https://go.microsoft.com/fwlink/?LinkId=550986>应用
>
>
>


-- 
Best regards,

Shaofeng Shi 史少锋

Reply via email to