Hm, well - that is just what I originally did. Items with the same COMP string are often next to each other after that, but not always, and there is no sorting of items with different COMP strings - if I do a manual numbering of the strings, I get e.g. 10, 25, 1, 26, 8, 8, 34, 8, 42, 41, and so on.
I made a screenshot to illustrate this:
The sort window looks like this:
Am I doing something wrong? Is there some special setting I may have wrong?