Look up ROW_NUMBER() - that would be my first guess at a solution. You will need to be able to identify the column(s) in the results where the sequence starts (partition) - and what determines first vs second vs third row (order by).
1 Like