PINNURI SAIKRISHNA PRASAD
04/30/2024, 2:58 AMJohn Kowtko
05/01/2024, 1:20 PMwith tmp_added as (
select channel, sum(added) Added, rank() over (order by sum(added) desc, channel) Rnk from wikipedia group by channel
), tmp_comment as (
select channel, max(commentLength) Comment, rank() over (order by max(commentLength) desc, channel) Rnk from wikipedia group by channel
), tmp_delta as (
select channel, avg(delta) Delta, rank() over (order by avg(delta) desc, channel) Rnk from wikipedia group by channel
)
select a.Rnk, a.channel Added, c.channel Comment, d.channel Delta
from tmp_added a
join tmp_comment c on a.Rnk = c.Rnk
join tmp_delta d on a.Rnk = d.Rnk
If you have any issues getting this to work please post your query and we can help.
To enable window functions remember to add the query context enableWindowing: true
Please note, that Group By is required to use Window Functions with the native query engine (when MSQ supports WindowFns it won't require it).