TableA
ID | Date_Time | Status
1 | 2005-06-10 13:00:28.407 | Success
2 | 2005-06-10 13:00:56.877 | Failure
1 | 2005-06-10 13:00:49.063 | Success
1 | 2005-06-10 13:00:51.547 | Success
1 | 2005-06-10 13:00:53.377 | Success
I want to return true or false if for a given ID there have been 3 failures in the last 60 minutes.
I can get the last 3 entries but how do I do the aggregate on the times vs the status? Is this quite a tricky statement?
select top 3 *
from TableA
order by Date_Time desc
Thanks for replies,
Naoise
ID | Date_Time | Status
1 | 2005-06-10 13:00:28.407 | Success
2 | 2005-06-10 13:00:56.877 | Failure
1 | 2005-06-10 13:00:49.063 | Success
1 | 2005-06-10 13:00:51.547 | Success
1 | 2005-06-10 13:00:53.377 | Success
I want to return true or false if for a given ID there have been 3 failures in the last 60 minutes.
I can get the last 3 entries but how do I do the aggregate on the times vs the status? Is this quite a tricky statement?
select top 3 *
from TableA
order by Date_Time desc
Thanks for replies,
Naoise