There are ways around this. If you want to know the last row entered into a table, then you will need to have a column that contains a timestamp of the row when it was inserted, or column with a sequential number stored in it. You can add the column to your table and then code a trigger to populate the column so that you do not have to change the application. Once you have that column populated, you can select the last row where that column contains the max value, similar to the following:
SELECT * FROM my_table t
WHERE t.colX = (SELECT MAX(colX) FROM my_table);
Dig Deeper on Oracle database design and architecture
Related Q&A from Brian Peasland
Oracle expert Brian Peasland answers one reader's question about common pitfalls when connecting Oracle to outside programs. Continue Reading
One reader asks expert Brian Peasland a question about datafile sizes with the Oracle RMAN duplicate 10g command. Continue Reading
Managing parent table-child table relations in Oracle SQL environments is key to efficient programming. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.