select
a.miner,
a.reward_per_tib/10^18 as "单T收益",
case
when increased_sector_count = 0 then 0
else (increased_initial_pledge/10^18)/((increased_sector_count*sector_size)/power(1024,4)) end as "单T抵押",
(a.pre_commit_sector_fee_per_tib+a.prove_commit_sector_fee_per_tib)/10^18 as "单T消耗",
lucky_ratio as "赢票率"
from
analyse_miner_efficient_daily a
更多的选择示例
case when Id=1 then '等于1'
when Id >=60 then '大于60' --注意各结果的数据类型须一致,int和时间等不能转为字符串没出错
when Id <60 then '小于60'
else 'ok' end
AS result