Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: last row inserted in the table
In 10g, you can specify ROWDEPENDENCIES for a table.
In that case, the SCN is stored at a row level. You can then easy get
the latest inserted rows.
If you don`t specify ROWDEPENDENCIES, the SCN is stored at the block level, so all the rows in one block will have the same SCN.
So in 10g, you can get the last inserted rows as following (with precision based on the above explanation):
SELECT * FROM t ORDER BY ORA_ROWSCN DESC;
Jan
Mariano napísal(a):
> How can I know what is the last row inserted in a table??? I have an
> ID column that is auto-incremented by the default auto-increment
> trigger.
>
> Can I be sure that MAX id number is the last row inserted?
Received on Mon Apr 16 2007 - 10:13:01 CDT