Carlosdl
29805 pts. | Sep 23 2009 1:55PM GMT
I agree with Meandyou.
You will need to provide more details, such as the complete table structure, the name of the column(s) you will use to order the results (and to be able to talk about “consecutive” records), confirm if you are using MySql and that you want to do this using SQL, etc…
Chhmusic
15 pts. | Sep 23 2009 3:27PM GMT
Hi and thanks for responding to my question:
Yes it is a MySQL database and I am using MySQL Browser to query with (or attempting to!).
I will give more details:
We are monitoring via a service for availability - this service is ‘pinged’ every minute. If it is available the Value = ‘0′, if it is not available ‘-1′. However, our grade is dinged only if the service is not available for >= 4 consecutive minutes.
The table has 3 columns:
ID
Value
Date_Time
Hopefully this will give you enough - it has been years and years since I last created an SQL query with if the smallest amount of complexity.
chhmusic
Carlosdl
29805 pts. | Sep 23 2009 6:14PM GMT
Kccrosser’s solution seems to be in T-SQL syntax, so you will need to adjust it to the MySql syntax, and I think it will be possible only if you are using MySql 5.0 (or above).
You might find these links useful:






