Can I count on Tables being sorted by the order of records inserted?

  • Thread starter Thread starter Marvin Cohen
  • Start date Start date
M

Marvin Cohen

If I insert records into a table in a certain order with a set of
"insert" statements, can I count on a sql statement such as "select *
from mytable" to always return those records in that order (assuming I
don't have a ORDER BY clause)?
Thanks,
Marvin
 
Tables will often *seem* to be sorted. That is, the records will *seem* to
be in some obvious order. This is for various reasons, none of which are
reliable. As the other respondent said, you must assume that each table is
randomly ordered, despite what you may see on the screen.

HTH,
TC
 
So... What can be the best solution for this kind of problem? Add a
time&sequential number field, like a GUID?
 
So... What can be the best solution for this kind of problem? Add a
time&sequential number field, like a GUID?

There is no "problem"! Tables do not have an order. To get the data out from
a table "in order", you must use a query with an ORDER BY clause, or a form
with the OrderBy[On] properties set.

TC
 
Further to this, if you are still reading, I guess we haven't really
answered your original question!

If you need to access table records in the order they were data-entered,
just define an autonumber field for that table, then access the table
through the following query:

SELECT * FROM YourTable ORDER BY TheAutoNumberField

HTH,
TC


TC said:
So... What can be the best solution for this kind of problem? Add a
time&sequential number field, like a GUID?

There is no "problem"! Tables do not have an order. To get the data out from
a table "in order", you must use a query with an ORDER BY clause, or a form
with the OrderBy[On] properties set.

TC

*seem*
table
 
Back
Top