Skip to content
Advertisement

Use rownum to indicate what rows I have pulled back

I have table of people, with firstname and lastname.

firstname lastname
a a
b b
c c
d d
e e
f f
g g
h h
i i
j j

I want to query from a specific point. For example.

Great. But what I would really like is for the result to tell me that result is actually from the 6th row. I have tried

But in that case, row_number will start from 1 when I want it to tell me that is actually the 6th element from the query

I want to do that without actually retrieving the first five rows.

Thanks

Advertisement

Answer

You can use a subquery to enumerate the rows, then filter in the outer query:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement