Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: last row inserted in the table
"Mariano" <mariano.calandra_at_gmail.com> a écrit dans le message de news: 1176663827.907399.11260_at_o5g2000hsb.googlegroups.com...
| On 15 Apr, 19:57, DA Morgan <damor..._at_psoug.org> wrote:
| > Mariano wrote:
| > > 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?
| >
| > What version and how was the table created?
| >
| > Generally speaking this question indicates a lack of understanding
| > of heap tables and how data is stored. But assuming that there is
| > a sequence and trigger:
| >
| > SELECT MAX(<id_column_name>)
| > FROM <table_name>;
| >
| > Keep in mind that unless you are working on a single-user system
| > this will inevitably give you an answer only valid for the current
| > session.
| > --
| > Daniel A. Morgan
| > University of Washington
| > damor..._at_x.washington.edu
| > (replace x with u to respond)
| > Puget Sound Oracle Users Groupwww.psoug.org
|
| i will use a timestamp column, max timestamp will be surely last
| insert.
|
But last, is last at insert time or at commit time?
Regards
Michel Cadot
Received on Mon Apr 16 2007 - 00:05:13 CDT
![]() |
![]() |