select AccountId,COUNT(*) as cnt from tablename group by AccountId having COUNT(*)<20
having 后面只能用 COUNT(*),不能用 cnt