There is a table tbl. somewhere on the other side, a service is launched, which with a certain time interval adds a new entry to the table.
example:
3 fields varA varchar, intB integer, timeC time
5 records
'value', 1, 19-00
'value', 2, 19-01
'value', 2, 19-02
'value', 3, 19-03
'value', 2, 19-04
you need to get only those records in which the value of the second field has changed, including the value that was ever before.
In this example, we get:
First recording
in the second record, the value has changed from 1 to 2, it should get into the resultset
in the third record, the value has not changed, it should NOT fall into the Resultset
in the fourth record changed from 2 to 3, in RESALTset
in the fifth one, it changed from 3 back to 2 (2 has already been done before), according to the conditions of the problem this record MUST get into resultset
Total we get that the resultset should consist of 4 entries
'value', 1, 19-00
'value', 2, 19-01
'value', 3, 19-03
'value', 2, 19-04
I can think up only to pass it the cursor, but it would be desirable selekt. I don't like cursors, I find them slow