java - Alphabetizing the names in SQL -


i have list of names needs sorted in alphabetical order, doing upper on values , order_by display sort.

hashmap<string, object> params = new hashmap<string, object>(); params.put( "order_by", "upper (value)" ); arraylist<dataobject> results = (arraylist<dataobject>) dao.getdataobjects( params, conn );  

sorting works fine more below scenario. example when sort name jacobson, jacobson. jacobson first , jacobson next, why not jacobson first , later jacobson ??

my guess because converting names upper case. while sorting names jacobson , jacobson treated jacobson , displays in random order ?

when convert uppercase you're getting ties names jacobson , jacobson, , yes: oracle arrange ties in (seemingly) random order. rid of randomness need tie-breaker.

note uppercase sorts before lowercase, if want jacobson sort before jacobson tie-breaker can this:

order upper(value), value desc 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -