悟生慧

 

使用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

posted on 2010-12-01 16:19  悟生慧  阅读(676)  评论(0编辑  收藏  举报

导航