How can I query for a sequence of values in a table I have a daily record of consumption for every day of a year i.e. 365 records.

I am looking for 10 consecutive zeros in the above - i.e. 10 days in a row where consumption is zero. I just need to know if such a sequence exists. I need to do this efficiently as I will have to do this for a lot of meters. 

This is the table, with some example data (with a sequence to be found between 2014-05-29 and 2014-06-10):

CREATE TABLE `Daily` (
`ID` int(10) NOT NULL auto_increment,
`MeterID` int(10) default NULL,
`TimeStamp` datetime default NULL,
`Value1` double default NULL
)
PRIMARY KEY  (`ID`) (index)


id          meterID value1      TimeStamp  
195142074   54438   246.492604  2014-05-01 00:00:00  
195142075   54438   29.844396   2014-05-02 00:00:00  
195142076   54438   0           2014-05-07 00:00:00  
195142077   54438   1.105348    2014-05-08 00:00:00  
195142078   54438   0           2014-05-09 00:00:00  
195142079   54438   79.585056   2014-05-27 00:00:00  
195142080   54438   1.105348    2014-05-28 00:00:00  
195142081   54438   0           2014-05-29 00:00:00  
195142082   54438   0           2014-05-30 00:00:00 
195142082   54438   0           2014-05-31 00:00:00
195142083   54438   0           2014-06-01 00:00:00
195142084   54438   0           2014-06-02 00:00:00
195142085   54438   0           2014-06-03 00:00:00
195142086   54438   0           2014-06-04 00:00:00
195142087   54438   0           2014-06-05 00:00:00
195142088   54438   0           2014-06-06 00:00:00
195142089   54438   0           2014-06-07 00:00:00
195142090   54438   0           2014-06-08 00:00:00
195142091   54438   0           2014-06-09 00:00:00
195142092   54438   0           2014-06-10 00:00:00   
195142093   54438   1.105348    2014-06-11 00:00:00  
..... (365 records in total)
just 9 joins
if ID is indexed the join will be efficient
if you have gaps in ID that needs to be compressed then this does not work  

select row1.* 
from table row1 
join table row2 
      on row2.id = row1.id + 1
     and row1.value = 0 
     and row2.value = 0
join table row3 
      on row3.id = row1.id + 2
     and row3.value = 0 
join table row4 
      on row4.id = row1.id + 3
     and row4.value = 0 
...
join table row10
      on row10.id = row1.id + 9
     and row10.value = 0 


if no negative values  

 select row1.id
   from table row1 
   join table row2 
         on row2.id &gt;= row1.id 
        and row2.id &lt;= row1.id + 10 
  group by row1.id 
 having sum(row2.value) = 0