使用having统计次数的用法

select cardId as 卡号,count(cardId) as 消费次数,formatdatetime(consumeTime,2) as 消费日期 from F_Consume
where consumeTime between #2010-11-01 00:00:00# and #2010-11-30 23:59:59#
group by formatdatetime(consumeTime,2),cardId having count(*)>=5

原文地址:https://www.cnblogs.com/wuhuisheng/p/1893590.html