AW: SQL natural sort question

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Thu Jan 31 12:48:18 CST 2013


On 1/31/13 12:13 PM, "Tiemo Hollmann TB" <toolbook at kestner.de> wrote:

Aha,

You want letters are numbers ...

Try todo google search
    "sort letters before numbers"

You will see some talks about this


> I have found a solution (I don¹t know if it works):
> ORDER BY
>   PropertyName,
>   CASE ISNUMERIC(MixedField + 'e0') WHEN 1 THEN 0 ELSE 1 END, -- letters after
> numbers
>   CASE ISNUMERIC(MixedField + 'e0') WHEN 1 THEN CAST(MixedField AS INT) ELSE 0
> END,
>   MixedField
>  
> But I don¹t know what to put in ³PropertyName² in this example.
> Any hint?
> Thanks
> Tiemo
>  
> 
> Von: valentina-bounces at lists.macserve.net
> [mailto:valentina-bounces at lists.macserve.net] Im Auftrag von Tiemo Hollmann TB
> Gesendet: Donnerstag, 31. Januar 2013 10:35
> An: Valentina Liste senden
> Betreff: OT: SQL natural sort question
>  
> Hello,
> perhaps somebody can give me a pointer. I have a text field with alphabetic
> (including diacritical chars) and numeric content where I do an ordered
> select. I could do the wanted ³natural sort² by program after the select, but
> I wonder if there is a more straight forward (and faster) way by Valentina /
> SQL without creating sql functions and stuff like this.

-- 
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