I think vijaydiwakar is right. b'coz oracle creates the rownum when a record is inserted into a table but not at the time of update in the record so it not possible to select the last updated records using the rownum, rather u have to add one more column say Updated which will contain the date on which the record is lastly updated.
Retriving Last ten modified Records
Collapse
X
-
-
DipakYadav,
Oracle doesn't create ROWNUM at the time of insertion. It's ROWID which gets created for each row when insertion happens. Oracle assigns unique number to each record at the time of select/update in the order it fetches the record from tables.Comment
-
query for last updated row
1.u may use modify command...
2.u may use alter command...
3.u may use update command....
so the records can be anywhere with in the table....
also you may modify or delete or alter or update before,hour,day ,month,year,, we dont have perfection in oracle sql..
but we can get the last row inserted....whi ch is utmost last
select * from emp where rowid=(select max(rowid) from emp);Comment
-
select * from emp where 2=(select count(*) from emp e where emp.sal<e.sal);
its also return the 3 hight salComment
Comment