How to add an offset in a "select" query in Oracle 11g.
I only know how to add the limit by e.g rownum <= 5
this question is not a duplicate, I already checked the other questions and are not related to mine.
So, how to add the offset in Oracle 11g ?
Use the function LAG or LEAD in oracle
Usage:-
Please find the this link for examples
You can do it easily on
12c
by specifyingOFFSET
.In
12c
,To do the same on
11g
and prior, you need to useROWNUM
twice,inner query
andouter query
respectively.The same query in
11g
,Here
OFFSET
is 4.You can use ROW_NUMBER function for that.
Maybe this helps:
Hope that helps