Select turnedOff/turnedOn time of interruptor in database

Select turnedOff/turnedOn time of interruptor in database

am 23.03.2005 14:51:35 von stephane.riff

Hi,

I have a db table like this :
DATETIME | ON_OFF |
2005-03-23 14:45:00 0
2005-03-23 14:45:15 0
2005-03-23 14:45:30 1
2005-03-23 14:45:45 1
2005-03-23 14:46:00 1
2005-03-23 14:46:15 1
2005-03-23 14:46:30 0
2005-03-23 14:46:45 0
2005-03-23 14:47:00 0
2005-03-23 14:47:15 1
2005-03-23 14:47:30 1
2005-03-23 14:47:45 0
2005-03-23 14:48:00 0
2005-03-23 14:48:15 0

It represent an interruptor on/off sequence.
Iwant to get the datetime off each state variation and know if it's a
turnedOn or a turnedOff value.
I don't see another solution that loop throw a resultSet of select *
query
and detect programmaticaly the changes.

Does someone know a way of doing this with SQL queries ???
Thanks