Click to See Complete Forum and Search --> : Sort characters in a string


bajis
10-02-2003, 06:52 PM
All,

I have a varchar(10) field in a table. I would like to sort the characters within a given string, in this field, in ascending order, using a SQL query.

i.e. If the field has "airlines" ... I would like to have "aeiilnrs" as the result (from my SQL query).

How can I do this?

Thank you for your time.

stecal
10-02-2003, 07:07 PM
Sorting homework problem? Impress your teacher by using bubble sort and PL/SQL collections.

Bubble sort algorithm:
http://www.cs.princeton.edu/~ah/alg_anim/gawain-4.0/BubbleSort.html

Collections:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#20425