分段统计数据
select fund_account,BrokerID,
sum(case when RulesID>1000000 AND RulesID<2000000 then 1 else 0 end ),
sum(case when RulesID>2000000 AND RulesID<3000000 then 1 else 0 end ),
sum(case when RulesID>3000000 AND RulesID<4000000 then 1 else 0 end ),
sum(case when RulesID>4000000 AND RulesID<5000000 then 1 else 0 end )
from investorrules where fund_account like '%1%' GROUP BY fund_account,BrokerID limit 1,21