日期:2014-05-18 浏览次数:20543 次
select time,id FROM table GROUP BY time,id HAVING count(tmp.lid)>200;
--总记录>100,查看对应的每天记录 select a.ID,a.[time],COUNT(*) as 每天记录 from (select ID from table1 group by ID having COUNT([time])>100) as a inner join table1 as b on a.ID=b.ID group by a.ID,a.[time]
------解决方案--------------------
是查某天某个ID超过了100次?
select id , convert(varchar(10),time,120) time from table1 group by id , convert(varchar(10),time,120) having count(1) > 100