Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- bl.player as PlayerName
- , bl.block_id as BlockId
- , bl.BrokenNet/tot.BrokenNet*100 as PercentOfAllBlocks
- , bl.BrokenNet as TheseBlocks
- , tot.BrokenNet as TotalBlocks
- from (
- SELECT
- PA.`player`
- , PA.`block_id`
- , sum(case when PA.`action_type`='block-break' then 1 else 0 end)
- -sum(case when PA.`action_type`='block-place' then 1 else 0 end) as BrokenNet
- from `prism_actions` as PA
- where PA.`action_type` in ('block-break','block-place')
- and PA.player not in ('','tnt','creeper')
- group by
- PA.`player`
- , PA.`block_id`
- having sum(case when PA.`action_type`='block-break' then 1 else 0 end)
- -sum(case when PA.`action_type`='block-place' then 1 else 0 end)>0
- ) as bl
- inner join (
- SELECT
- PA.`player`
- , sum(case when PA.`action_type`='block-break' then 1 else 0 end)
- -sum(case when PA.`action_type`='block-place' then 1 else 0 end) as BrokenNet
- from `prism_actions` as PA
- where PA.`action_type` in ('block-break','block-place')
- group by
- PA.`player`
- having sum(case when PA.`action_type`='block-break' then 1 else 0 end)
- -sum(case when PA.`action_type`='block-place' then 1 else 0 end)>0
- ) as tot
- on tot.player = bl.player
- order by PercentOfAllBlocks desc
- ;
Advertisement
Add Comment
Please, Sign In to add comment