e.g., "foo bar boz baz"

Is there a pure-SQL, Midrange-compatible, way to sort the "words" in the
field (producing "bar baz boz foo" in the above example)?

I take it the SQL is a hard requirement? If not, it's almost trivial
in iSeries Python:

result = sorted(input_field.split())

The above gives a list of individual elements. If you needed them
reconstituted into a single string, it would be

result = ' '.join(sorted(input_field.split()))


This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page