Query editor
with invest_amount_interval_detail as(selectcasewhen -total_cost < 100 then '[1] 0~100'when -total_cost < 1000 then '[2]100~1k'when -total_cost < 5000 then '[3] 1k~5k'when -total_cost < 10000 then '[4] 5k~1w'when -total_cost < 50000 then '[5] 1w~5w'when -total_cost < 100000 then '[6]5w~10w'when -total_cost < 1000000 then '[7]10w~1m'else '[8] >1m'END as invest_amount_interval,if(yield > 0,1,0) as is_profitfrom query_2387053)selectinvest_amount_interval,count(1) as address_count,sum(is_profit) as profit_address_count,cast(sum(is_profit) as double )/count(1) as ratiofrom invest_amount_interval_detail group by invest_amount_interval