vijayr
07-18-2002, 12:32 PM
Hi All,
I need to select the previous and next record, when the value of column is changed for that record.
I tried with lag function, but I couldn’t succeed. I’m using oracle 8.1.6 Version.
My table structure is as follows:
Account_No number(10)
Payment_type number(5)
Installment_Type number(5)
Date_chage date
Sample record:
Account_No Payment_Type Installment_Type Date_change
70539 1 2 01-OCT-83
70539 1 2 03-FEB-01
70539 1 2 26-APR-02
70539 1 1 21-JUN-02
70539 1 2 12-JUL-02
185562 1 2 23-APR-02
185562 2 2 10-MAY-02
My output should be like this:
Account_No Payment_Type Installment_Type Date_change
70539 1 2 26-APR-02
70539 1 1 21-JUN-02
70539 1 2 12-JUL-02
185562 1 2 23-APR-02
185562 2 2 10-MAY-02
Can anyone help me to achieve this?
Thanks and regards,
Vijay R.
I need to select the previous and next record, when the value of column is changed for that record.
I tried with lag function, but I couldn’t succeed. I’m using oracle 8.1.6 Version.
My table structure is as follows:
Account_No number(10)
Payment_type number(5)
Installment_Type number(5)
Date_chage date
Sample record:
Account_No Payment_Type Installment_Type Date_change
70539 1 2 01-OCT-83
70539 1 2 03-FEB-01
70539 1 2 26-APR-02
70539 1 1 21-JUN-02
70539 1 2 12-JUL-02
185562 1 2 23-APR-02
185562 2 2 10-MAY-02
My output should be like this:
Account_No Payment_Type Installment_Type Date_change
70539 1 2 26-APR-02
70539 1 1 21-JUN-02
70539 1 2 12-JUL-02
185562 1 2 23-APR-02
185562 2 2 10-MAY-02
Can anyone help me to achieve this?
Thanks and regards,
Vijay R.