[SQL] 查询指定某个条件的记录数

select AccountId,COUNT(*) as cnt from AccountReturnIndex 
group by AccountId
having COUNT(*)<20
原文地址:https://www.cnblogs.com/wynlfd/p/7158858.html