Questions regarding lenght() function

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Mar 31 07:21:30 CDT 2007


On 31/3/07 1:14 PM, "Thorsten Hohage" <thohage at objectmanufactur.com> wrote:

>> TH>         select idserial, length(descriptiontext) from cb_group
>> order by
>> TH> length(descriptiontext) desc
>> 
>> TH> I got a
>> TH>         12:45:13: Error: line 1:1: unexpected token: (
>> 
>> You should do it in that way:
>> select idserial, length(descriptiontext) as 'A' from cb_group order by
>> A
>> 
>> BTW  -  seems  to  be more natural then duplicating expression just to
>> mention column in ORDER BY clause.
> 
> Yes THIS is obviously the natural was, but are you sure you TRY such
> a query, before suggesting it?????
> 
> Just because this was my first try and yes I forgot to mention it -
> sorry!
> 
> 13:11:13: Error: "Order by not original-table field" is not supported.
> 13:11:13: Error: Kernel error: 0xa000
> 13:11:13: Error: "Order by not original-table field" is not supported.
 
In "worse case" you can try create Table Method (virtual field) and use it
for ORDER BY. 

This also is good BECAUSE you can mark this field as Indexed, so Valentina
will build INDEX for length() result. And this speed up query a lots.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list