In relational database theory, there is no concept of the "first" or "last" row of a table. And using ROWNUM wouldn't...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
help here either as you are not guaranteed any specific ordering in the table.
Most people who have this requirement add a column to the table of DATE datatype (or maybe TIMESTAMP) and then create a trigger to update this column's value with the current date and time on INSERT. If you can't modify this table's structure, then you can create another table consisting of this table's primary key column(s) and the column to show when that PK value was inserted into the original table. Then create a trigger to populate your newly created table when a row is inserted into the original table.
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.