Re: order by not consistent

From: Andrew Hardy <nobody_at_spam.from.news.AdvanticaTech.com>
Date: Fri, 26 Jul 2002 09:06:17 +0100
Message-ID: <ahqvt4$rph$1_at_sun-cc204.lut.ac.uk>


Barry,

"bgt0990" <btighe_at_neometrics.com> wrote in message news:3d40517a$1_4_at_corp-goliath.newsgroups.com...
>
> SQLString := 'SELECT distinct labno FROM RESULT_MASTER WHERE BATCHID
=
> :1';
> SQLSTRING := sqlstring ||' AND TESTSEQ < 99';
> SQLSTRING := sqlstring ||' ORDER BY LABNO';

You are loading data into your table using the ORDER BY. This does not guarantee that, when you later access the table, the data will be returned in the same order, although using TRUNCATE to empty and reset the entire table before the insert improves the chances.

In order to retrieve the data in the order that you want it for your reports you must include the ORDER BY in the report select statement.

Andy Received on Fri Jul 26 2002 - 10:06:17 CEST

Original text of this message