Subject [firebird-support] Re: User defined self-join order (KAO: Svein)
Author Svein Erling Tysvær
>Yes it helped thanks a lot Svein. It worked without a problem.

Good to hear, Bhavbhuti!

>What do you fear that might not work in a future version of FireBird?

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.

>How large result set is large? Are a few thousand records fine as that is anticipated.

A few thousand should no problem, that's a tiny dataset. I was more thinking if mAccounts contained millions of rows.

>Is this fine if I just use ORDER BY iSrNo as I felt bit nervous if the iID or iPID
>were a factor for the ordering as accounts could be created in any order and any
>dependency on the iID being lower for a higher-up-in-the-tree-account.

Sure, that's fine, I just wondered whether the result set would be ordered the same way as before for records not having iSrNo.

Set