Unanswered: Omitting consecutive records repeating the data in a given column
I have a db2 table where a code represents personal letter-writing at a given address. The records will be ordered by the date of that letter-writing in another column. I seek a report that omits all subsequent *consecutive* records with the same code in the address column but includes any later return to that address with, again, omission of any subsequent consecutive records at that address.
GROUP BY selects just one of the records at that address (or 2, for MIN and MAX may be applied to the date column). The report I envisage will have as many records as there are returns to the given address plus the first one.
The result would be the space-time history of a famous author. I'd be most grateful for tips on how to reach the result.
I have not been able to get what exactly you mean by "subsequent *consecutive* records". It would be more clear if you could illustrate your problem with examples.
Anyways what I am listing is kind of shot in semi-dark. Let's see what modifications you want in the resultset.
Thanks for attempting to solve my problem. In your example the date1 data should be different. Thus only the code column has repeating data for consecutive records in the order chosen for the current report. I have modified your example table to show what I mean and your example report to show what I'm trying to get: