By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,759 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,759 IT Pros & Developers. It's quick & easy.

inserts and select

P: 3
If I insert rows in a table with no index, is select guaranteed to return the rows in the order it was inserted.
Note: I am not doing any updates, deletes - pure inserts.
In my small test that I did, it always retrieves in the order I inserted. But not sure if there are any case where it can retrieve in a different order.
Jan 31 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 534
I think you should not make any assumptions about the default select order.
If you have no idexes, and you did not run any UPDATEs on the table you may find that in most cases you get your result sorted by ROWID (that is in the same order the rows were created).
However there's no quarantee that this would be always the case; just as you cannot expect that ROWIDs are always in sync with the INSERT order.
Feb 1 '07 #2

P: 3
I think you should not make any assumptions about the default select order.
If you have no idexes, and you did not run any UPDATEs on the table you may find that in most cases you get your result sorted by ROWID (that is in the same order the rows were created).
However there's no quarantee that this would be always the case; just as you cannot expect that ROWIDs are always in sync with the INSERT order.
thanks for your reply. That's exactly what I want to find out under what circumstances will this happen ? If I am inserting let's say 1000 rows in one transaction, under what circumstances will the ROWIDs will not be in sync with the insert order ?
Feb 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.