Joined: 07 Feb 2007
|I would suggest this:
DECLARE C CURSOR FOR
SELECT S.NO, EMP_ID, EMP_NAME, EMP_SALARY
GROUP BY EMP_ID
ORDER BY S.NO;
Fetch each row, store it in working storage, fetch next row.
Compare the EMP_IDs of current and previous. Both should be same. Identify the changed value prepare a report.
As simple as that.
I assume that for each update the insert is done according the increasing order of S.No.
P.S: Do I make any sense or Am I completely wrong?