1

In database queries, clients often asked to group values into ranges, "Low", "Medium","High" which make sense when read by a human. But if the computer returns strings, they sort alphabetically not conceptually, e.g. "Low","High","Med" since 'L'<'H'<'M'.

We could prepend numbers, "1-Low", "2-Med","3-High", etc. but wonder if there's a sequence of short simple English words that also sorts correctly.

  • 5
    Bottom Middle Top – TaliesinMerlin Apr 30 at 18:01
  • 1
    @TaliesinMerlin Bacon Mackerel Tomato? – JJJ Apr 30 at 18:16
  • 2
    High, higher, highest. – Weather Vane Apr 30 at 18:23
  • 2
    min, med, max and reverse the sort... – user888379 Apr 30 at 19:20
  • Great answers. @JJJ I will make that sandwich tomorrow. – prototype May 1 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.