Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lead And Lag Functions In Oracle

Rajan SwApr 22 2014 — edited Apr 22 2014

Hi ,

I have a scenario to find the next sal from the employee table like if the two salaries are same it should not show the next salary to the same  instead it should show the next bigger salary like below

Suppose I have

Empid        Sal

1               2000

2               3000

3               3000

4               5000

So for employee_id 2 , the next salary I am expecting to be 5000 which is the next bigger salary for 3000 , So for both the records the next salary to be 5000.

Is it possible using lead function.

I have one more query , What is the default windowing clause in the analytical function is it unbounded preceding and current row.

Please share your valuable thoughts

Regards,

Prafull

This post has been answered by Moazzam on Apr 22 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2014
Added on Apr 22 2014
7 comments
478 views