AW: SQL natural sort question
Tiemo Hollmann TB
toolbook at kestner.de
Thu Jan 31 04:13:19 CST 2013
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.
Thanks
Tiemo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20130131/bf3eab89/attachment.html>
More information about the Valentina
mailing list