Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Find rows with a change in a field compared with the previous row
Hi all,
I have a Table like
SESSION_ID | LIGHT_ON
1 | Y 2 | Y 3 | Y 4 | Y 5 | N 6 | N 7 | N 8 | Y 9 | Y 10 | Y 11 | Y 12 | Y 13 | Y 14 | N 15 | N
I'm interested in the rows where
the status of the light changed.
For example:
SESSION_ID | STATUS
5 | OFF 8 | ON 14 | OFF
Is there a way to do this with simple SQL?
Thanks Björn
tel +49(0)241/9437-417
fax +49(0)241/9437-431
Received on Mon Jun 06 2005 - 08:58:51 CDT