MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » October 2012

Re: Another SQL question (yes, I know, I'm getting annoying; at least this is a different project)



fixed

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()))

John





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

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact