select AccountId,COUNT(*) as cnt from tablename group by AccountId having COUNT(*)<20
having 后面只能用 COUNT(*),不能用 cnt
select AccountId,COUNT(*) as cnt from tablename group by AccountId having COUNT(*)<20
having 后面只能用 COUNT(*),不能用 cnt
转载于:https://www.cnblogs.com/wynlfd/p/7232671.html