Subject Re: [firebird-support] order by
Author Andrea Raimondi
To avoid those cases, I will usually wrap the long and complex expression in an outer select giving it an intuitive column name.
It does not work in *all* cases, but it does work in most.

A


On Mon, Apr 7, 2014 at 3:05 PM, Tim Ward <tdw@...> wrote:


Thanks. Knowing this reasoning, one can then use one's judgement in comparing this reason against a desire to avoid repeating a long complex expression which could also lead to a maintenance risk.


On 07/04/2014 15:02, Andrea Raimondi wrote:
 
I am of this opinion because SQL scripts change and what is today column number 2 may become column number 14 two days later.
This, in turn, leads to potential problems because you think it's ordering by something whereas instead it's ordering by something else.

A


On Mon, Apr 7, 2014 at 2:58 PM, Tim Ward <tdw@...> wrote:


On 07/04/2014 12:40, Andrea Raimondi wrote:
 

And anyway, you should never be using an order by number - unless there is really no way around it, in my opinion.
When people make statements like that it would be really helpful if they were to say *why* they are of this opinion, otherwise the reader doesn't gain anything.
-- 
Tim Ward


-- 
Tim Ward





--
Mr. Andrea Raimondi
Senior Software Analyst&Developer