I would like to get the data from previous row. I have used LAG function but did not get the expected result.
Table:-
col1 col2 col3 ABCD 1 Y ABCD
Thank you all for the replies. By using the lag function with partition I got the expected result. I missed to used partition previously and due to that I was getting wrong results.