Subject Re: User defined self-join order (KAO: Svein)
Author venussoftop
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær <svein.erling.tysvaer@...> wrote:
> There is no ORDER BY on the final result set and not even on the CTE. I don't know whether there is some reason for CTEs to be returned in a particular order - so far I've thought of them as being a way to produce a temporary table, and tables just store data, they're not ordered. It might well be that the order isn't random, I just don't know.

Okay, so the worry is that a future version may bring out records in a different manner and without an ORDER BY we'd observe something similar we observed previously. Putting a ORDER BY was my first shot at the past-present problem.

Is there any other way to get the order, without too much coupling with the tree structure, instead of the iSrNo field, that I have used? The app in this regards is still fresh to be updated without much pains at this stage, if it would help in future-proofing the SQL query.

Please advise.

Thanks and regards.
Bhavbhuti