I've always wondered how the database determines the order of rows returned by a SELECT statement when there is no ORDER BY clause.
Suppose a table "Animals" with 1 column, and three rows:[tt]
__CommonName__
Dog
Cat
Bird
[/tt]
Suppose the following SELECT statment:[tt]
SELECT CommonName FROM Animals[/tt]
The SELECT statement has no ORDER BY clause so why is the data always returned in the same order?
How is the order determined by the database?
If is it the order in which the rows were added, does the database keep some hidden field value to account for this?
Suppose a table "Animals" with 1 column, and three rows:[tt]
__CommonName__
Dog
Cat
Bird
[/tt]
Suppose the following SELECT statment:[tt]
SELECT CommonName FROM Animals[/tt]
The SELECT statement has no ORDER BY clause so why is the data always returned in the same order?
How is the order determined by the database?
If is it the order in which the rows were added, does the database keep some hidden field value to account for this?