I can group by seconds or minutes with something like the following:
SELECT datepart(minute, Time)
,count(*) as hits
FROM Log
GROUP BY datepart(minute, Time)
Is there a way I can do the same thing, but with a specified amount of seconds, so group by "every 10 seconds" for example?
More info:
This is combined with a Where Time between as well:
SELECT datepart(minute, Time)
,count(*) as hits
FROM Log with (nolock)
WHERE Time between dateadd(minute, -2, getdate()) and getdate()
GROUP BY datepart(minute, Time)