Dear kmak:
I used the term RankOrder to refer to a single column of your table (which
you did not specify). I am assuming there is some column in the table by
which you intend to order the rows of the table in order to make the concept
of a "row number" for every row feasible. Without some ordering of the
table, no such concept as "row number" is sensible.
If you have such a column, substitute its name for "RankOrder" in my sample.
If it requires more than one column to properly order the rows in your
table, then the query will become more complex. If you cannot order the
rows by some combination of columns, the query is impossible.
I had to invent such columns because your original post contains few details
of what you're doing. If you will give such specifics, I can provide more
specific solutions. I suggest you could post the query to which you want to
"add a dynamic counter". From that, I can probably be quite specific. Be
sure to add sorting to this query so it puts the results into the order you
want them counted.