0

please, how can I select the oldest records in a table in oracle? and if it is possible to show them by date. Thank you

closed as unclear what you're asking by ypercubeᵀᴹ, Marco, Michael Green, McNets, mustaccio Feb 12 at 15:03

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 7
    Is there a date or timestamp column? – ypercubeᵀᴹ Feb 11 at 21:29
  • 5
    In addition to Ypercube's obvious question ;) if you can provide/create a small working sample (ie table with 5 or 6 rows and a few columns relevant to you ??) we could work on that much easier ;) – Ditto Feb 11 at 21:33
  • 1
    Do you have Flashback Data Archive enabled? – Michael Kutz Feb 11 at 23:42
  • 1
    select the oldest records in a table Oldest - by insertion or by last edition? Does the column which contains the timestamp of the last action in interest exists in the table structure? If no, and the action in interest is insertion - does the autoincrement column exists? – Akina Feb 12 at 4:40
  • Thanks for your collaboration, the table in question does not have any colum with dates, timestamp ... neither autoincrementales ... it would be something like for example: columns Name1 Name2 Age Salary only – miguel ramires Feb 17 at 4:34
3

Oracle does not, itself, track the date a row is inserted into a table. So unless you yourself design the table with something like a DATE_INSERTED column, and reigorously enforce the proper population of that column, then the answer to "how can I select the oldest records in a table in oracle?" is "you can't".

2

First Rule of Relational Databases - Rows in a Table have no intrinsic order.

If you want to know when a record was added or updated, then you need to keep track of that for yourself.

Not the answer you're looking for? Browse other questions tagged or ask your own question.