AW: AW: SQL natural sort question
Tiemo Hollmann TB
toolbook at kestner.de
Fri Feb 1 09:41:40 CST 2013
I wanted a mixed list sorted as this:
a
ä
b
1
2
10
20
I have searched the forums and am completely puzzeled. So many different
solutions which I hardly can't adapt, sql is not my strength. So I will stay
on an unsorted SELECT and do the sort by program afterwords.
Thanks
Tiemo
> -----Ursprüngliche Nachricht-----
> Von: valentina-bounces at lists.macserve.net [mailto:valentina-
> bounces at lists.macserve.net] Im Auftrag von Ruslan Zasukhin
> Gesendet: Donnerstag, 31. Januar 2013 19:48
> An: valentina at lists.macserve.net
> Betreff: Re: AW: SQL natural sort question
>
> 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]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list