Order of rows in temp tables
Posted in 1998
Hi,
We have made a little experiment with temp tables and would appreciate
that someone confirme the results.
Let's say we have TableA (ColA Integer, ColB Char(10), ColC smallint);
We issue the folowing query:
Select ColA, ColB from TableA where ColC = 2 order by ColA, ColB intotemp TempA;
Here whe have in TempA the subset of TableA that should be ordered by
ColA & ColB.
Then we issue that other query:
Select ColA, ColB from TempA;or
Select ColA, ColB from TempA where ColA >= 100;
In these cases, the rows from TempA are returned ordered by ColA & ColB,
even if we don`t specify the order by clause, probably because of the
physical order of the data in TempA.
My question is : Can we assume that the rows of the temp table will
always be returned in the physical order of the table if we don`t
spedify an order by clause in our query.
What makes me hesitate to implement this is that I think that the clause
"order by" with "into temp" was a invalid syntax in earlier version of
Informix.
Thanks,
Martin