What you suggests works fine but it's not what I'm looking for.
My example with fruit and kilograms is, as you can imagine, extremely semplified compared to the real db.
I have in my original table some 40/50 columns so in the straight table object I get only one result for each fruit only if I select columns with equal values, but if I put all the columns I get many values for each fruit.
Additionally I would like to avoid having a firstsortedvalue column.
Isn't there a way to achieve what I need working on the (main) script, so that I can drop and completely forget about all the data I don't need?