select * from tablename group by time,ID having count(ID)>=3
等级
本版专家分:117
select *
from record
group by ManID
having count(ManID)>3
等级
本版专家分:3097
select ManID , left(convert(varchar(20) , TheDatetime , 20),10) as TheDatetime from record
group by manid , TheDatetime
having count(*) > 3
匿名用户不能发表回复!
--表信息 连锁店编号 会员卡号 录入员工号录入终端录入时间 2012001001 12345678 20120000010000000120120510 16:29:23 2012001001 12345678 20120000010000000120120510 16:30:44 ...
刷卡进出数据存储在同一表中,姓名有重复的,一个人可能刷了2次,要求选出在时间段2014-12-28 11:00:00到2014-12-28 13:00:00内两次刷卡记录时间间隔大于等于40分钟的员工 logtime (时间 )logcard (卡号 )logid...