select value,max(points) as punti
from fields_values, userpoints
where field_id=2 and user_id=userid
group by value