Subject | Re: [firebird-support] Re: order by column alias problem |
---|---|
Author | Helen Borrie |
Post date | 2004-12-20T05:20:02Z |
At 08:58 PM 19/12/2004 -0700, you wrote:
that isn't standard-compliant. "Compelling reasons" would no doubt include
future changes to the standard.
From a logical POV, it doesn't make sense to derive a field just for the
purpose of changing its name, since it detaches the output column from the
originating column and precludes the use of an index to speed the sorting.
The purposeful usage of derived fields is to output values that really are
derived from an expression (rather than simply renamed, as in your
example). In that case, Firebird allows the Order By criterion to be a
complete restatement of the original expression: the "by degree"
alternative is coder shorthand for that and is (currently) standard SQL
syntax. The expression will be evaluated both at SELECT time and at
ordering time, whether you choose the restate the expression or to use the
degree number.
There are indications that the standard will deprecate the "by degree"
option in future...not sure why...maybe Arno or Ann can answer.
./hb
>I hacked the persistence layer to fix it.... This is a great persistenceIt would take compelling reasons for Firebird to "someday support" syntax
>layer and I hate to add:
>if (engine.equals("FIREBIRD") type things to it.... but it is fixed so I
>guess I will get on with my life....
>
>The people that wrote the layer (open for business (ofbiz.org) entity
>engine) seem to use postgres for internal development. I like postgres
>but firebird's native support for windows and linux is great, plus it is
>so easy to maintain.... I could go on. This is just a minor setback...
>maybe someday firebird will support this syntax.
that isn't standard-compliant. "Compelling reasons" would no doubt include
future changes to the standard.
From a logical POV, it doesn't make sense to derive a field just for the
purpose of changing its name, since it detaches the output column from the
originating column and precludes the use of an index to speed the sorting.
The purposeful usage of derived fields is to output values that really are
derived from an expression (rather than simply renamed, as in your
example). In that case, Firebird allows the Order By criterion to be a
complete restatement of the original expression: the "by degree"
alternative is coder shorthand for that and is (currently) standard SQL
syntax. The expression will be evaluated both at SELECT time and at
ordering time, whether you choose the restate the expression or to use the
degree number.
There are indications that the standard will deprecate the "by degree"
option in future...not sure why...maybe Arno or Ann can answer.
./hb