Am Mittwoch, 25. August 2010, 18:22:13 schrieb Paul Eggert: > On 08/24/2010 11:57 PM, Bernhard Schiffner wrote: > > 2146427 /LBAtoJM/ROOT/WEB-INF/lib/hibernate-3.2.0.cr3.jar > > 214618118 /temp/marketing_ms/emails.dat > > That won't work, because the two lines are not sorted correctly. > Recall that join uses lexicographic comparison, not numeric. > Its input must be sorted lexicographically. Ok. I solved my problem using the attached patch. The patch shows that it is possible to use different sortings for keys (joinfield) in join. I integrated some / most of the code from sort.c verbaly in order to see what's needed to compile it successfully in join.c . I did no tests beside my special usecase mentioned earlier. It's clear that a user-friendly key-selection needs a lot more work. Same is about a unified version of join and sort. Thanks to Paul and Christian Perle for their valueable help so far. The FSF can make any use of the code here. It was theirs already before ;-) Bernhard