Relative Content

Tag Archive for sqloracle-database

Repeating sequence within a group of data

I am having difficulty in writing one SQL query. The need I have is with in a group of rows I have to assign a sequence for each row for which I can simply use rank to write my query.
However, I need to also use the lower limit and upper limit of the sequence number and if the upper limit is crossed, I have to start again from lower limit.