Re: Natural sort

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Fri, 3 Oct 2008 10:57:41 +0200
Message-ID: <48e5de8e$0$199$e4fe514c@news.xs4all.nl>

""�lvaro G. Vicario"" <alvaroNOSPAMTHANKS_at_demogracia.com> schreef in bericht news:gc4ivc$1ne$1_at_huron.algomas.org...
> Does Oracle 10g have a so called "natural sort" feature? E.g.:
>
> foo1
> foo2
> foo10
> foo100
>
> ... rather than:
>
> foo1
> foo10
> foo100
> foo2
>
> Docs says I can use NLSSORT() in ORDER BY clauses but available values for
> NLS_SORT do not seem to cover this case. I Google for "natural sort in
> oracle" and all I get is how to do it in C++ and PHP...
>
>
> --
> -- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
> -- Mi sitio sobre programaci�n web: http://bits.demogracia.com
> -- Mi web de humor al ba�o Mar�a: http://www.demogracia.com
> --

I don't think so. You could write a pl/sql function, returning foo001
foo002
foo010
foo100

and sort on this function (you could even create a function based index on it)

Shakespeare Received on Fri Oct 03 2008 - 03:57:41 CDT

Original text of this message