Sequential record update grouping query