group by, having

QQ截图20150430161844

select sum(user)+type from deposit;
QQ截图20150430162454
select sum(user+type) from deposit;
QQ截图20150430162554

select deposit.*, max(sum) from deposit group by user, type having max(sum)>300;
QQ截图20150430162745

select deposit.*, max(sum) from deposit group by user having max(sum)>300;
QQ截图20150430162904