alirsUntitled Query
    Updated 2022-09-07
    with base as(select iff(len(POOL_NAME)>10,(SUBSTRING(POOL_NAME, 0, charindex('-', POOL_NAME, 0)-1)),POOL_NAME)as Pool_Name,
    sum(SWAP_VOLUME_RUNE) as SWAP_VOLUME_in_RUNE,
    row_number() over (order by SWAP_VOLUME_in_RUNE desc) as rank
    from flipside_prod_db.thorchain.daily_pool_stats
    where SWAP_VOLUME_RUNE_USD>0 and SWAP_VOLUME_RUNE>0
    group by 1
    order by 2 desc
    )
    SELECT * from base
    where rank<=10

    Run a query to Download Data