Re: Sorting strings
Posted in 1998
First there is no upper function in version 7.2. Upgrading to version 7.3 would get that. In that case using upper in the where clause wouldn't help. However the following would if that is the order he wants: select upper(field_to_sort_by), other_fields... where ... order by 1 If Amir wants the real value of the field_to_sort_by in the result (which is probably the case) that field would have to be included another time in the select list without the upper function used on it and he would have to live with the extra field in there used only for sorting. This could be done on version 7.2 as well using the stored procedure version of the upper function awailable at the IIUG site. However the performance may not be particularly good. For advanced sorting purposes we have used an extra field in the table that's updated by the application to sort in quite different orders. With GLS there are some sorting options as well. I have never used them, but have read about dictionary ordering and other items. However I think they are applied on a database wide case which isn't allways appropriate. In my cases such advanced ordering have only been appropriate for a few fields while all others should be sorted the normal way. On Fri, 04 Sep 1998 08:04:22 +0200, Dirk Niemeier <dirk.niemeier@stueken.de> wrote: >Hi Amir, >try the upper function in your where-clausel to get uppercase and >lowercase in the right order. > >Dirk Niemeier > >> Hi, >> >> I'm trying to 'order by' a varchar column in my database but it's >> not ordering the way that I want. By default, the database sorts >> the word 'allow' AFTER 'Zebra'. I want to change the database's >> sorting behavior so it would sort 'allow' BEFORE 'Zebra'. I have >> looked into the GLS Guidebook but I cannot find any specific >> instructions. Does anyone have any ideas? I am running Informix >> On-line Server version 7.2. Thanks. >> >> -amir > > Nils Myklebust NM Data AS Norway E-mail: Nils.Myklebust@nmdata.com FAQ at: http://www.iiug.org/techinfo/faq/faq_top.html (Now with ODBC info under "Third party products".)