How to order by the first created record? [message #220040] |
Sun, 18 February 2007 00:51 |
eshta
Messages: 33 Registered: February 2006 Location: Saudi Arabia
|
Member |
|
|
Hi to all,
I have a table with a primary key that is created not in sequence.
This gave me problem when I want to display the records by the first created records.
In other word, I want to view the records order by first created while I didn't record any value that referes to that?
Is there any reserved word that I can use in order by?
|
|
|
|
Re: How to order by the first created record? [message #220055 is a reply to message #220041] |
Sun, 18 February 2007 03:45 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Frank wrote on Sun, 18 February 2007 18:12 | That is only possible if you have a column from which you can determine the order of inserts. Oracle does NOT keep track of that automatically.
|
Ooh, ooh!! It's not often you get the chance to gazumph Frank, so when you get a half-gazumph, you gotta take your shot!
How about this?
Havent tried it myself, but if you are using 10g it might work:
SELECT *
FROM tab
ORDER BY ORA_ROWSCN;
Ross Leishman
|
|
|
|
|
|
|
|
|
|
|