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!

Need to fetch the last record/row from a table

798678Mar 28 2011 — edited Mar 28 2011
Hi,

I have a requirement like fetching the closing balance of the last record of the table and inserting the same into the opening balance of the immediatetly created next record.

In simple words, I need to fetch a value from the last row of the record.

For example, I use the below query,

select rownum, empno, ename from emp
where rownum = (select count(rownum) from emp);

But, the above query does not return any of the record.

Hence, need help on this.

Regards,
Shivakumar A

Edited by: shiva on Mar 27, 2011 10:14 PM
This post has been answered by 825902 on Mar 28 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2011
Added on Mar 28 2011
9 comments
550 views