I have the following scenario, and the only way I can think of doing this is to pull back all the data into a temp table and then use a cursor to loop through it, updating a record or the last record depending on the current record.I have the following scenario, and the only way