the endweight category has values: 1,0 ; 2,0; 5,0 ; 10,0
the pseudocode formula is
Weightgroup.beginweight<= weight< Weightgroup.endweight
So in SQL I think it's something like this, but i could be off:
Update Order O set O.weightgroup = (select O.weight from Weightgroup W join Order O on W.nr = O.weightgroup where W.beginweight<= O.weight and O.weight < W.endweight
It doesn't give any errors, but no value appears in O.weightgroup either.