我通过咨询才知道的sql语句写法

1.取用户个数,并且条件是balance相加>1000的

select count(*),region from (select region, entityid,sum(balance) from am_score_balance where scorecycle='200801'
group by region,entityid
having
sum(balance)>1000)
group by region;

 

 

请使用浏览器的分享功能分享到微信等